This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
How to pop -c in gdb
- From: "William K. Foster" <wkf at sinavigator dot com>
- To: gdb at sourceware dot org
- Date: Tue, 09 Jan 2007 16:51:01 -0800
- Subject: How to pop -c in gdb
- Reply-to: wkf at sinavigator dot com
Hello,
When I used dbx and at the prompt called a function which got a SEGV or
something, I could do "pop -c" to recover from my call and return to the
point I was at in the program being debugged where I typed in the
expression that failed.
I would like to do the same in gdb, the closest I could find is the
return command however the program being debugged can not continue.
-------------------------------------------------------------------------------------------------------------------------
Here is a sample session that shows this:
Breakpoint 11, snDesktop::openSchematicWindow (this=0x830e188,
schDesign=0x46a5f792, newWindow=true, w=-1, h=-1) at snDesktop.cc:1928
(gdb) p window->x()
$26 = 0
(gdb) p window
$27 = (snSchemWindow *) 0x9fd3310
(gdb) p $27->x()
Reading in symbols for painting/qbackingstore.cpp...done.
Program received signal SIGSEGV, Segmentation fault.
0x42d05bda in QWidgetPrivate::q_func (this=0x0) at qwidget_p.h:157
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on"
Evaluation of the expression containing the function (QWidget::x()
const) will be abandoned.
(gdb) where 9
#0 0x42d05bda in QWidgetPrivate::q_func (this=0x0) at qwidget_p.h:157
#1 0x42d03010 in QWidgetPrivate::frameStrut (this=0x0) at qwidget.cpp:8420
#2 0x42cf7fbf in QWidget::x (this=0x9fd3310) at qwidget.cpp:2614
#3 <function called from gdb>
#4 snDesktop::openSchematicWindow (this=0x830e188,
schDesign=0x46a5f792, newWindow=true, w=-1, h=-1) at snDesktop.cc:1928
#5 0x42136caa in snDtLibBrowser::openView (this=0x831eae0, openMode=114
'r', windowType=2) at snDtLibBrowser.cc:308
#6 0x421364ca in snDtLibBrowser::openDesign (this=0x831eae0,
item=0x8889f10) at snDtLibBrowser.cc:178
#7 0x421d42b1 in snDtLibBrowser::qt_metacall (this=0x831eae0,
_c=InvokeMetaMethod, _id=6, _a=0xbfffd970) at moc_snDtLibBrowser.cc:104
#8 0x4352681b in QMetaObject::activate (sender=0x831eae0,
from_signal_index=58, to_signal_index=58, argv=0xbfffd970) at
qobject.cpp:2938
(gdb) return
(gdb) return
(gdb) return
(gdb) where 9
#0 snDesktop::openSchematicWindow (this=0x830e188,
schDesign=0x46a5f792, newWindow=true, w=-1, h=-1) at snDesktop.cc:1928
#1 0x42136caa in snDtLibBrowser::openView (this=0x831eae0, openMode=114
'r', windowType=2) at snDtLibBrowser.cc:308
#2 0x421364ca in snDtLibBrowser::openDesign (this=0x831eae0,
item=0x8889f10) at snDtLibBrowser.cc:178
#3 0x421d42b1 in snDtLibBrowser::qt_metacall (this=0x831eae0,
_c=InvokeMetaMethod, _id=6, _a=0xbfffd970) at moc_snDtLibBrowser.cc:104
#4 0x4352681b in QMetaObject::activate (sender=0x831eae0,
from_signal_index=58, to_signal_index=58, argv=0xbfffd970) at
qobject.cpp:2938
#5 0x43526aaf in QMetaObject::activate (sender=0x831eae0, m=0x42a72218,
local_signal_index=8, argv=0xbfffd970) at qobject.cpp:2981
#6 0x429d0025 in Q3ListView::doubleClicked (this=0x831eae0,
_t1=0x8889f10, _t2=@0xbfffd9a8, _t3=0) at moc_q3listview.cpp:320
#7 0x42845248 in Q3ListView::contentsMouseDoubleClickEvent
(this=0x831eae0, e=0xbfffd9f0) at q3listview.cpp:4515
#8 0x428b5019 in Q3ScrollView::viewportMouseDoubleClickEvent
(this=0x831eae0, e=0xbfffdf10) at q3scrollview.cpp:1753
(gdb) fin
Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
-------------------------------------------------------------------------------------------------------------------------
It seems gdb can not recover from the recursive error like dbx is able
to do.
Thanks for your help.
-William