Subject: bug#13303: 24.2.91; gdb under emacs broken for break commands

From: Stephen Leake <[email-masked]>
Date: Sat, 29 Dec 2012 07:31:07 -0500

Eli Zaretskii <[email-masked]> writes:

>> M-x gdb
>> Run gdb (like this): gdb -i=mi hello

Forgot to say the gdb version is 7.4.1-1

>> at the gdb prompt, set a breakpoint:
>> break hello.c:4
>> 
>> try to set commands:
>> command 1
>> 
>> should see a prompt, terminate by 'end'. Instead, see:
>> (gdb) command 1
>> Type commands for breakpoint(s) 1, one per line.
>> End with a line saying just "end".
>
> Aren't the last 2 lines the prompt you expected to see?  

Yes, but each following line should be prompted with '>'.

>> p argc
>> end
>> p argc
>> end
>> (gdb)
>> 
>> This was terminated by Menu | Signals | EOF
>
> Why did you send EOF?  

Because "end" didn't work, and I was trying other things.

> That command causes the debugger to quit, so what's the purpose of
> sending it here?

It does cause it to quit under Windows in this situation, but not under
Debian. 

>> On Windows 7, the behavior is slightly different; the '>' prompt is
>> visible, but EOF crashes gdb.
>
> Not really a crash, at least on my XP SP3.  It exits after reporting
> some weird error message about stdin, which is expected, since Emacs
> closes the debugger's stdin file descriptor.  What kind of "crash" did
> you see on Windows 7?

The same as yours; I agree "crash" is the wrong word.

> Anyway, the annoyance with no "> " prompt on Posix hosts is a known
> problem with GDB versions older than 7.5; see bug#11279.  You can work
> around it by typing this command at the first GDB prompt:
>
>   (gdb) set interactive-mode off
>
> GDB 7.5 fixed that problem, so upgrading your GDB will remove the need
> to use the above work-around.

That does restore the "> " prompt, but it also restores EOF behavior (it
now quits the debugger). 

So the core problem remains: there is no way to terminate prompting
for new command lines, without quiting the debugger.

(I realize I did not state the main problem clearly in my initial
report).

I have not installed gdb 7.5; it's not in Debian testing (that's at gdb
7.4), and it's not supported for my main work, which has an AdaCore
support contract, with gdb 7.3.

-- 
-- Stephe