Subject: Re: bug#61973: M-x gdb ends up with infinite prompts before starting the process

From: Eli Zaretskii <[email-masked]>
Date: Sun, 05 Mar 2023 10:04:43 +0200

> Date: Sun, 5 Mar 2023 03:13:35 +0200
> From: Dmitry Gutov <[email-masked]>
> 
> 1. Run compiled 'emacs' from 'src'.
> 2. M-x gdb
> 3. Answer prompt: Run gdb (like this): gdb -i=mi ./emacs
> 4. See this prompt repeated indefinitely, no matter what I answer:
> 
> This GDB supports auto-downloading debuginfo from the following URLs:
> https://debuginfod.ubuntu.com
> Enable debuginfod for this session? (y or [n]) Please answer y or [n].
> 
> (Emacs 29, more or less latest.)

What GDB version is that?  If this is a recent problem, did it start
happening because you upgraded to a newer GDB version?

By "no matter what I answer, do you mean you tried both "y RET" and
"n RET", and the question is repeated regardless?

I don't have access to a system with a new enough GDB where debuginfod
is enabled, so I need you to please test the possible solutions.

First, if you invoke GDB from the shell's prompt in the same way,
i.e.

  $ gdb -i=mi ./emacs

does it then ask the same question?  And if you then type "y RET",
does it stop asking, and does debugging Emacs then works as expected?
Can you show me the entire output of this session invoked from the
shell's prompt, up to and including the reaction to your "y RET"
response?

Next, can you enable gdb-enable-debug minor mode, and post the
contents of gdb-debug-log (formatted with pp, please) after these
questions are asked and you answer them?

Finally, if you add the following line to your ~/.gdbinit, does the
problem go away?

  set debuginfod enabled on

(If you don't have a ~/.gdbinit file, create it and add this single
line to it.)  With this line, GDB should not ask the question at all.

Thanks.