* bug#13303: 24.2.91; gdb under emacs broken for break commands @ 2012-12-29 4:04 Stephen Leake 2012-12-29 8:17 ` Eli Zaretskii 0 siblings, 1 reply; 9+ messages in thread From: Stephen Leake @ 2012-12-29 4:04 UTC (permalink / raw) To: 13303 This bug report will be sent to the Bug-GNU-Emacs mailing list and the GNU bug tracker at debbugs.gnu.org. Please check that the From: line contains a valid email address. After a delay of up to one day, you should receive an acknowledgment at that address. Please write in English if possible, as the Emacs maintainers usually do not have translators for other languages. Please describe exactly what actions triggered the bug, and the precise symptoms of the bug. If you can, give a recipe starting from `emacs -Q': create file hello.c: #include <stdio.h> int main (int argc, char *argv[]) { printf ("hello world\n"); return 0; } /* end main */ compile it, with gcc (Debian 4.7.2-4) 4.7.2: gcc -g -o hello hello.c run it: ./hello debug it: M-x gdb Run gdb (like this): gdb -i=mi hello 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". p argc end p argc end (gdb) This was terminated by Menu | Signals | EOF On Windows 7, the behavior is slightly different; the '>' prompt is visible, but EOF crashes gdb. In GNU Emacs 24.2.91.1 (i686-pc-linux-gnu, GTK+ Version 2.24.10) of 2012-12-28 on Shevek Windowing system distributor `The Cygwin/X Project', version 11.0.11301000 System Description: Debian GNU/Linux testing (wheezy) Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Debugger Minor modes in effect: shell-dirtrack-mode: t tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: w <backspace> SPC w o r l d " ) ; <return> { <S-backspace> } C-x C-s C-x 2 M-x s h e l l <return> l s SPC * . c <return> g c c SPC h e l l o w . <backspace> <backspace> . c <return> <C-up> <return> . / h e l l o <return> l s <return> . / a . o u t <return> C-x o <up> <left> <left> <down> <left> <down> <left> <left> <left> <left> \ n M-x r e v i e <backspace> <backspace> e r t - b u f f e r <return> y e s <return> <down> <down> <down> <right> <right> <right> <right> <right> <right> <right> <right> \ n C-x C-s C-x o M-x g d b C-g g c c <up> <down> <C-up> <C-up> <C-up> <C-up> <left> <left> <left> <left> <left> <left> <left> - g SPC - o SPC h e l l o SPC <return> . / h e l l o <return> r m SPC a . o u t <return> M-x g d b <return> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> h e l l o <return> C-x p b r e a k SPC h e l l o w . <backspace> <backspace> . c : C-x o C-x o 4 <return> c o m m a n d SPC 1 <return> p SPC a r g c <return> e n d <return> <help-echo> <help-echo> <help-echo> <help-echo> <help-echo> <help-echo> <help-echo> <menu-bar> <signals> <eof> <help-echo> <help-echo> <help-echo> M-x b u g - r e p <tab> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> <backspace> r e p o r t <tab> <return> Recent messages: History item: 1 hello.c changed on disk; really edit the buffer? (y, n, r or C-h) n ask-user-about-supersession-threat: File changed on disk: /home/Projects/opentoken/org.opentoken/Build/linux_release/hello.c Saving file /home/Projects/opentoken/org.opentoken/Build/linux_release/hello.c... Wrote /home/Projects/opentoken/org.opentoken/Build/linux_release/hello.c Quit History item: 1 History item: 2 History item: 3 History item: 4 Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message cl-macs gv format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils shell pcomplete cc-langs cl cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs ada-mode advice help-fns cl-lib advice-preload easymenu compile which-func imenu align find-file gdb-mi bindat json gud easy-mmode comint ansi-color ring vc-dispatcher vc-mtn make-mode time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#13303: 24.2.91; gdb under emacs broken for break commands 2012-12-29 4:04 bug#13303: 24.2.91; gdb under emacs broken for break commands Stephen Leake @ 2012-12-29 8:17 ` Eli Zaretskii 2012-12-29 12:31 ` Stephen Leake 0 siblings, 1 reply; 9+ messages in thread From: Eli Zaretskii @ 2012-12-29 8:17 UTC (permalink / raw) To: Stephen Leake; +Cc: 13303 > Date: Fri, 28 Dec 2012 23:04:21 -0500 > From: Stephen Leake <stephen_leake@stephe-leake.org> > > M-x gdb > Run gdb (like this): gdb -i=mi hello > > 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? If not, what prompt did you expect? What do you see when you run the same GDB commands from the shell prompt? > p argc > end > p argc > end > (gdb) > > This was terminated by Menu | Signals | EOF Why did you send EOF? That command causes the debugger to quit, so what's the purpose of sending it here? > 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? 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. ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#13303: 24.2.91; gdb under emacs broken for break commands 2012-12-29 8:17 ` Eli Zaretskii @ 2012-12-29 12:31 ` Stephen Leake 2012-12-29 12:55 ` Eli Zaretskii 0 siblings, 1 reply; 9+ messages in thread From: Stephen Leake @ 2012-12-29 12:31 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 13303 Eli Zaretskii <eliz@gnu.org> 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 ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#13303: 24.2.91; gdb under emacs broken for break commands 2012-12-29 12:31 ` Stephen Leake @ 2012-12-29 12:55 ` Eli Zaretskii 2012-12-29 15:28 ` Stephen Leake 0 siblings, 1 reply; 9+ messages in thread From: Eli Zaretskii @ 2012-12-29 12:55 UTC (permalink / raw) To: Stephen Leake; +Cc: 13303 > From: Stephen Leake <stephen_leake@stephe-leake.org> > Cc: 13303@debbugs.gnu.org > Date: Sat, 29 Dec 2012 07:31:07 -0500 > > > 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). I don't understand: you are supposed to end the breakpoint commands by typing just "end" at the "> " prompt. It works for me with GDB 7.3 and Emacs 24.2.91 on GNU/Linux; if it doesn't work for you, please tell what happens when you type "end" to end the breakpoint commands. So what happens when sending EOF is not really relevant here, IMO. (That command only works on GNU/Linux at the top level, not during specification of breakpoint commands.) > So the core problem remains: there is no way to terminate prompting > for new command lines, without quiting the debugger. See above: "end" works for me. ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#13303: 24.2.91; gdb under emacs broken for break commands 2012-12-29 12:55 ` Eli Zaretskii @ 2012-12-29 15:28 ` Stephen Leake 2012-12-29 17:19 ` Eli Zaretskii 2012-12-29 17:54 ` Eli Zaretskii 0 siblings, 2 replies; 9+ messages in thread From: Stephen Leake @ 2012-12-29 15:28 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 13303 Eli Zaretskii <eliz@gnu.org> writes: >> From: Stephen Leake <stephen_leake@stephe-leake.org> >> Cc: 13303@debbugs.gnu.org >> Date: Sat, 29 Dec 2012 07:31:07 -0500 >> >> > 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). > > I don't understand: you are supposed to end the breakpoint commands by > typing just "end" at the "> " prompt. Yes, that is what I was expecting. > It works for me with GDB 7.3 and Emacs 24.2.91 on GNU/Linux; Sigh. I hate bugs that behave differently on different machines. My GNU/Linux is Debian Testing; what are you using? What Windows are you using? I'm on Windows 7; I could try on Windows XP. > if it doesn't work for you, please tell what happens when you type > "end" to end the breakpoint commands. I get another prompt. (that's why there are two 'end's in the bug report). > So what happens when sending EOF is not really relevant here, IMO. Right. Except that it is a workaround for the bug on Debian, if I don't execute "set interactive-mode off". If it was also a workaround on Windows, I could live with it. >> So the core problem remains: there is no way to terminate prompting >> for new command lines, without quiting the debugger. > > See above: "end" works for me. Any suggestions for debugging this further? I've confirmed that 'end' works as expected when running gdb from a bash shell not under emacs. 'end' also works when running gdb in a bash shell under emacs. I guess that's a mostly functional workaround. 'end' works with Emacs 23, running gdb with --annotate=3; it seems to be the switch to -i=mi that causes the problem for me. I tried reading the gdb interface elisp code; it's very dense, so I didn't get very far, but I could try again. I did confirm that Emacs 24 no longer supports --annotate=3. -- -- Stephe ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#13303: 24.2.91; gdb under emacs broken for break commands 2012-12-29 15:28 ` Stephen Leake @ 2012-12-29 17:19 ` Eli Zaretskii 2012-12-29 18:40 ` Stephen Leake 2012-12-29 17:54 ` Eli Zaretskii 1 sibling, 1 reply; 9+ messages in thread From: Eli Zaretskii @ 2012-12-29 17:19 UTC (permalink / raw) To: Stephen Leake; +Cc: 13303 > From: Stephen Leake <stephen_leake@stephe-leake.org> > Cc: 13303@debbugs.gnu.org > Date: Sat, 29 Dec 2012 10:28:16 -0500 > > > I don't understand: you are supposed to end the breakpoint commands by > > typing just "end" at the "> " prompt. > > Yes, that is what I was expecting. > > > It works for me with GDB 7.3 and Emacs 24.2.91 on GNU/Linux; > > Sigh. I hate bugs that behave differently on different machines. > > My GNU/Linux is Debian Testing; what are you using? It's Trisquel, the machine is fencepost.gnu.org. I think this is some variety of Ubuntu, but I don't know enough about genealogy of Linux distributions to tell. In any case, GDB 7.3 on that system was built by me, it's not something that came with the OS. > What Windows are you using? I'm on Windows 7; I could try on Windows XP. It's XP SP3. Do you mean you don't get "(gdb)" after typing "end" on Windows as well? > Any suggestions for debugging this further? Perhaps turn on gdb-enable-debug, and see what you get in the gdb-debug-log variable. > I've confirmed that 'end' works as expected when running gdb from a bash > shell not under emacs. > > 'end' also works when running gdb in a bash shell under emacs. I guess > that's a mostly functional workaround. > > 'end' works with Emacs 23, running gdb with --annotate=3; it seems > to be the switch to -i=mi that causes the problem for me. What if you run GDB from the shell, but using the -i=mi switch, and set interactive-mode off? do you see the problem then? > I did confirm that Emacs 24 no longer supports --annotate=3. It does, if you invoke "M-x gud-gdb RET". Another work-around, I guess. But I still would like to find out why it doesn't work for you with -i=mi? ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#13303: 24.2.91; gdb under emacs broken for break commands 2012-12-29 17:19 ` Eli Zaretskii @ 2012-12-29 18:40 ` Stephen Leake 2012-12-29 18:56 ` Eli Zaretskii 0 siblings, 1 reply; 9+ messages in thread From: Stephen Leake @ 2012-12-29 18:40 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 13303 Eli Zaretskii <eliz@gnu.org> writes: > It's XP SP3. Do you mean you don't get "(gdb)" after typing "end" on > Windows as well? Correct. >> Any suggestions for debugging this further? > > Perhaps turn on gdb-enable-debug, and see what you get in the > gdb-debug-log variable. That shows the failure: gdb-debug-log ((recv . "~\">\" ") (mi-send . #("-interpreter-exec console \"end\" " 27 30 (fontified t))) (recv . "~\">\" ") (mi-send . #("-interpreter-exec console \"p argc\" " 27 33 (fontified t))) (recv . "~\">\" ") (mi-send . #("-interpreter-exec console \"command 1\" " 27 36 (fontified t))) (recv . "16^error,msg=\"No registers.\" (gdb) 17^done,threads=[] (gdb) This list is in reverse chronological order; the first ">" is the prompt received after the "end". >> I've confirmed that 'end' works as expected when running gdb from a bash >> shell not under emacs. >> >> 'end' also works when running gdb in a bash shell under emacs. I guess >> that's a mostly functional workaround. >> >> 'end' works with Emacs 23, running gdb with --annotate=3; it seems >> to be the switch to -i=mi that causes the problem for me. > > What if you run GDB from the shell, but using the -i=mi switch, and > set interactive-mode off? do you see the problem then? The prompting does terminate with 'end' then. There is no output from gdb during the break command prompting: stephe@Shevek$ gdb -i=mi hello =thread-group-added,id="i1" ~"GNU gdb (GDB) 7.4.1-debian\n" ~"Copyright (C) 2012 Free Software Foundation, Inc.\n" ~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type \"show copying\"\nand \"show warranty\" for details.\n" ~"This GDB was configured as \"i486-linux-gnu\".\nFor bug reporting instructions, please see:\n" ~"<http://www.gnu.org/software/gdb/bugs/>...\n" ~"Reading symbols from /home/Projects/opentoken/org.opentoken/Build/linux_release/hello..." ~"done.\n" (gdb) set interactive off &"set interactive off\n" ^done (gdb) break 4 &"break 4\n" ~"Breakpoint 1 at 0x8048415: file hello.c, line 4.\n" =breakpoint-created,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x08048415",func="main",file="hello.c",fullname="/home/Projects/opentoken/org.opentoken/Build/linux_release/hello.c",line="4",times="0",original-location="hello.c:4"} ^done (gdb) command 1 &"command 1\n" ~">" p argc ~">" end =breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x08048415",func="main",file="hello.c",fullname="/home/Projects/opentoken/org.opentoken/Build/linux_release/hello.c",line="4",times="0",script={"p argc"},original-location="hello.c:4"} ^done (gdb) quit &"quit\n" So that is the expected behavior >> I did confirm that Emacs 24 no longer supports --annotate=3. > > It does, if you invoke "M-x gud-gdb RET". Another work-around, I > guess. That works; it actually runs "gdb --fullname"; that seems to be all I need. > But I still would like to find out why it doesn't work for you with > -i=mi? I'd like to know as well; I assume support for --fullname/--annotate=3 will go away at some point. Is there another (non-emacs) front-end that uses gdb -i=mi that I can try, to see if it works there? I found 'xxgdb' for Debian; it closes immediately after starting, with an unhelpful error message. I'm running via ssh -X, that may be part of the problem. Not available on Cygwin. -- -- Stephe ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#13303: 24.2.91; gdb under emacs broken for break commands 2012-12-29 18:40 ` Stephen Leake @ 2012-12-29 18:56 ` Eli Zaretskii 0 siblings, 0 replies; 9+ messages in thread From: Eli Zaretskii @ 2012-12-29 18:56 UTC (permalink / raw) To: Stephen Leake; +Cc: 13303 > From: Stephen Leake <stephen_leake@stephe-leake.org> > Cc: 13303@debbugs.gnu.org > Date: Sat, 29 Dec 2012 13:40:02 -0500 > > Eli Zaretskii <eliz@gnu.org> writes: > > > It's XP SP3. Do you mean you don't get "(gdb)" after typing "end" on > > Windows as well? > > Correct. Is that with native Emacs and GDB, or with Cygwin builds thereof? > > Perhaps turn on gdb-enable-debug, and see what you get in the > > gdb-debug-log variable. > > That shows the failure: > > gdb-debug-log > ((recv . "~\">\" > ") (mi-send . #("-interpreter-exec console \"end\" > " 27 30 (fontified t))) (recv . "~\">\" > ") (mi-send . #("-interpreter-exec console \"p argc\" > " 27 33 (fontified t))) (recv . "~\">\" > ") (mi-send . #("-interpreter-exec console \"command 1\" > " 27 36 (fontified t))) (recv . "16^error,msg=\"No registers.\" > (gdb) > 17^done,threads=[] > (gdb) What can I say? it's strange. I even tried with GDB 7.4.1 on Windows (don't have it on GNU/Linux), and after "set interactive-mode off", "end" ends the breakpoint commands and gets me back to the GDB prompt. > > But I still would like to find out why it doesn't work for you with > > -i=mi? > > I'd like to know as well; I assume support for --fullname/--annotate=3 > will go away at some point. Maybe someone else could chime in and suggest ideas. > Is there another (non-emacs) front-end that uses gdb -i=mi that I can > try, to see if it works there? http://sourceware.org/gdb/wiki/GDB%20Front%20Ends lists a few. ^ permalink raw reply [flat|nested] 9+ messages in thread
* bug#13303: 24.2.91; gdb under emacs broken for break commands 2012-12-29 15:28 ` Stephen Leake 2012-12-29 17:19 ` Eli Zaretskii @ 2012-12-29 17:54 ` Eli Zaretskii 1 sibling, 0 replies; 9+ messages in thread From: Eli Zaretskii @ 2012-12-29 17:54 UTC (permalink / raw) To: Stephen Leake; +Cc: 13303 > From: Stephen Leake <stephen_leake@stephe-leake.org> > Cc: 13303@debbugs.gnu.org > Date: Sat, 29 Dec 2012 10:28:16 -0500 > > > It works for me with GDB 7.3 and Emacs 24.2.91 on GNU/Linux; > > Sigh. I hate bugs that behave differently on different machines. Btw, does the problem happen for you in "emacs -Q"? ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2012-12-29 18:56 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-12-29 4:04 bug#13303: 24.2.91; gdb under emacs broken for break commands Stephen Leake 2012-12-29 8:17 ` Eli Zaretskii 2012-12-29 12:31 ` Stephen Leake 2012-12-29 12:55 ` Eli Zaretskii 2012-12-29 15:28 ` Stephen Leake 2012-12-29 17:19 ` Eli Zaretskii 2012-12-29 18:40 ` Stephen Leake 2012-12-29 18:56 ` Eli Zaretskii 2012-12-29 17:54 ` Eli Zaretskii
Code repositories for project(s) associated with this public inbox https://git.savannah.gnu.org/cgit/emacs.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).