From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25998 invoked by alias); 10 Jan 2007 00:51:31 -0000 Received: (qmail 25970 invoked by uid 22791); 10 Jan 2007 00:51:29 -0000 X-Spam-Check-By: sourceware.org Received: from post.sinavigator.com (HELO post.sinavigator.com) (216.218.185.251) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 10 Jan 2007 00:51:23 +0000 Received: from localhost (localhost [127.0.0.1]) by post.sinavigator.com (Postfix) with ESMTP id DA1A91CE4D for ; Tue, 9 Jan 2007 16:51:19 -0800 (PST) Received: by post.sinavigator.com (Postfix, from userid 65534) id 5281A1CE40; Tue, 9 Jan 2007 16:51:18 -0800 (PST) Received: from [127.0.0.1] (fs1.sinavigator.com [192.168.0.10]) by post.sinavigator.com (Postfix) with ESMTP id 69B6A1CDE8 for ; Tue, 9 Jan 2007 16:51:17 -0800 (PST) Message-ID: <45A43875.4020808@sinavigator.com> Date: Wed, 10 Jan 2007 00:51:00 -0000 From: "William K. Foster" Reply-To: wkf@sinavigator.com User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: gdb@sourceware.org Subject: How to pop -c in gdb Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-01/txt/msg00159.txt.bz2 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 #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