Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "William K. Foster" <wkf@sinavigator.com>
To: gdb@sourceware.org
Subject: How to pop -c in gdb
Date: Wed, 10 Jan 2007 00:51:00 -0000	[thread overview]
Message-ID: <45A43875.4020808@sinavigator.com> (raw)

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


             reply	other threads:[~2007-01-10  0:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-10  0:51 William K. Foster [this message]
2007-01-10  2:51 ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45A43875.4020808@sinavigator.com \
    --to=wkf@sinavigator.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox