[Converted from Gnats 2559] According to the gdb manual, stop hooks were executed before the stack frame information was printed when the program was stopped. This got broken by this patch: http://sourceware.org/ml/gdb-patches/2008-09/msg00193.html Running the hook code before printing the stack frame is useful for things like debugging JITted code, i.e. the hook could load symbol information for the JITted code using add-symbol-file. Release: GNU gdb (GDB) 6.8.50.20081126-cvs Environment: debian unstable amd64 How-To-Repeat: define hook-stop echo "Hello." end break main run In gdb 6.8, the "Hello" message was printed before the stack frame, in the cvs version, it is printed after.
Responsible-Changed-From-To: unassigned->palves Responsible-Changed-Why: I'll fix this.
State-Changed-From-To: open->analyzed State-Changed-Why: Tagging the threads as stopped will have to be done a bit earlier than. normal_stop is full of tricky bits.
Subject: Bug 9664 CVSROOT: /cvs/src Module name: src Changes by: palves@sourceware.org 2009-01-23 15:47:03 Modified files: gdb : ChangeLog infrun.c gdb/testsuite : ChangeLog Added files: gdb/testsuite/gdb.base: hook-stop-frame.c hook-stop-frame.exp Log message: 2009-01-23 Pedro Alves <pedro@codesourcery.com> PR gdb/9664: * infrun.c (normal_stop): Tag threads as stopped, and run the hook-stop before printing the stack frame. 2009-01-23 Pedro Alves <pedro@codesourcery.com> PR gdb/9664: * gdb.base/hook-stop-frame.c, gdb.base/hook-stop-frame.exp: New. Patches: http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.10134&r2=1.10135 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/infrun.c.diff?cvsroot=src&r1=1.353&r2=1.354 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.1790&r2=1.1791 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.base/hook-stop-frame.c.diff?cvsroot=src&r1=NONE&r2=1.1 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.base/hook-stop-frame.exp.diff?cvsroot=src&r1=NONE&r2=1.1
I've just checked in a patch to address this. The next snapshot will have this fixed. I've also added a new test to the testsuite so we don't forget about this again. Thanks for catching this!