* No (gdb) prompt when assert
@ 2012-08-21 9:20 Liang Wang
0 siblings, 0 replies; only message in thread
From: Liang Wang @ 2012-08-21 9:20 UTC (permalink / raw)
To: emacs-devel
Hi,
With gdb MI in Emacs trunk, I lose (gdb) prompt frequently. One of
test cases is after assertion happens. Here is what I do.
1. M-x gdb to start debugging
2. r RET to run and stop when assertion happens
3. R RET to restart debugging
I almost always lost (gdb) prompt at step 3. Otherwise, it will
happen if I keep press RET to restart. Test case is simple hello
world.
#include <stdio.h>
#include <assert.h>
int main(int argc, char *argv[])
{
printf ("hello, world.\n");
assert(0);
return 0;
}
I am afraid that this problem is related to the usage of variable
gdb-first-done-or-error.
gdb-prompt-name, which holds string "(gdb) ", is concated into output
when gdb-first-done-or-error is not nil in either gdb-done-or-error or
gdb-stopped. Unfortunately, if gdb-done-or-error happens before
gdb-stopped and gdb-prompt-name is not concated into output in
gdb-done-or-error, it will not be concated in gdb-stopped. Here is
the code in gdb-done-or-error,
(when gdb-first-done-or-error
(unless (or token-number gud-running no-proc)
(setq gdb-filter-output (concat gdb-filter-output gdb-prompt-name)))
(gdb-update no-proc)
(setq gdb-first-done-or-error nil))
because of unless condition statement, it is possible that
gdb-prompt-name is not concated into output.
The following is the value of output-record-list in
gud-gdbmi-marker-filter after (setq output-record-list (sort
output-record-list 'gdb-car<)) is executed. You can see that gdb-done
happens before gdb-stopped and token-number of gdb-done is "20". So
the condition of unless is true, and gdb-prompt-name is not concated
into output. Then, gud-gdbmi-marker-filter is set to nil. This cause
gdb-stopped will not concat gdb-prompt-name either.
((0 gdb-ignored-notification
"id=\"/lib/ld-linux.so.2\",target-name=\"/lib/ld-linux.so.2\",host-name=\"/lib/ld-linux.so.2\",symbols-loaded=\"0\",thread-group=\"i1\""
nil 141) (141 gdb-thread-selected "id=\"1\"" nil 165) (165 gdb-gdb nil
nil 172) (172 gdb-done "20" "threads=[{id=\"1\",target-id=\"process
16445\",name=\"hello\",state=\"running\",core=\"3\"}],current-thread-id=\"1\""
285) (285 gdb-gdb nil nil 292) (292 gdb-ignored-notification
"id=\"/lib/i386-linux-gnu/libc.so.6\",target-name=\"/lib/i386-linux-gnu/libc.so.6\",host-name=\"/lib/i386-linux-gnu/libc.so.6\",symbols-loaded=\"0\",thread-group=\"i1\""
nil 466) (466 gdb-stopped
"reason=\"signal-received\",signal-name=\"SIGABRT\",signal-meaning=\"Aborted\",frame={addr=\"0xb7fdd424\",func=\"__kernel_vsyscall\",args=[]},thread-id=\"1\",stopped-threads=[\"1\"],core=\"0\""
nil 651))
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-08-21 9:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-21 9:20 No (gdb) prompt when assert Liang Wang
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.