From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14320 invoked by alias); 23 Jun 2010 02:53:48 -0000 Received: (qmail 14312 invoked by uid 22791); 23 Jun 2010 02:53:47 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-px0-f169.google.com (HELO mail-px0-f169.google.com) (209.85.212.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 23 Jun 2010 02:53:43 +0000 Received: by pxi17 with SMTP id 17so2049508pxi.0 for ; Tue, 22 Jun 2010 19:53:41 -0700 (PDT) Received: by 10.143.26.1 with SMTP id d1mr6264568wfj.311.1277261621310; Tue, 22 Jun 2010 19:53:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.143.32.8 with HTTP; Tue, 22 Jun 2010 19:53:21 -0700 (PDT) In-Reply-To: <4C211717.60505@linux.vnet.ibm.com> References: <1277212708-11125-1-git-send-email-emachado@linux.vnet.ibm.com> <4C20F60C.5060409@vmware.com> <4C211717.60505@linux.vnet.ibm.com> From: Hui Zhu Date: Wed, 23 Jun 2010 02:53:00 -0000 Message-ID: Subject: Re: [PATCH] Quit after debugging corefiles To: Edjunior Barbosa Machado Cc: Michael Snyder , "gdb-patches@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-06/txt/msg00493.txt.bz2 I reproduce this issue too. Thanks, Hui On Wed, Jun 23, 2010 at 04:03, Edjunior Barbosa Machado wrote: > > > On 06/22/2010 02:42 PM, Michael Snyder wrote: >> >> Hmm, I don't think you're supposed to "continue" when debugging a core >> file... > > I meant I had already started debugging (with breakpoints and 'run') befo= re, > which is permitted in the current version (although I noticed this behavi= or > has been discussed in the thread that Pedro previously mentioned). > > You can see the full output below. Sorry if it was unclear in the beginni= ng. > > Using the following faulty code: > > $ cat -n corefile-quit.c > =A0 =A0 1 =A0#include > =A0 =A0 2 > =A0 =A0 3 =A0static void > =A0 =A0 4 =A0fault_func (char *arg) > =A0 =A0 5 =A0{ > =A0 =A0 6 =A0 =A0*arg =3D 0; /* segfault */ > =A0 =A0 7 =A0} > =A0 =A0 8 > =A0 =A0 9 =A0int main (int argc, char *argv[]) > =A0 =A010 =A0{ > =A0 =A011 =A0 =A0char *ptr =3D NULL; > =A0 =A012 > =A0 =A013 =A0 =A0printf("hello world\n"); > =A0 =A014 > =A0 =A015 =A0 =A0fault_func (ptr); > =A0 =A016 > =A0 =A017 =A0 =A0return 0; > =A0 =A018 =A0} > > $ ./gdb -q ./corefile-quit core > Reading symbols from > /home/emachado/work/gdb/community/build/gdb/corefile-quit...done. > [New Thread 17524] > > warning: Can't read pathname for load map: Input/output error. > Reading symbols from /lib/i686/cmov/libc.so.6...(no debugging symbols > found)...done. > Loaded symbols for /lib/i686/cmov/libc.so.6 > Reading symbols from /lib/ld-linux.so.2...(no debugging symbols > found)...done. > Loaded symbols for /lib/ld-linux.so.2 > Core was generated by `./corefile-quit'. > Program terminated with signal 11, Segmentation fault. > #0 =A00x080483ca in fault_func (arg=3D0x0) at corefile-quit.c:6 > 6 =A0 =A0 =A0 =A0 *arg =3D 0; /* segfault */ > Setting up the environment for debugging gdb. > Function "internal_error" not defined. > Make breakpoint pending on future shared library load? (y or [n]) [answer= ed > N; input not from terminal] > Function "info_command" not defined. > Make breakpoint pending on future shared library load? (y or [n]) [answer= ed > N; input not from terminal] > .gdbinit:8: Error in sourced command file: > Argument required (one or more breakpoint numbers). > (gdb) b 14 > Breakpoint 1 at 0x80483ec: file corefile-quit.c, line 14. > (gdb) r > Starting program: /home/emachado/work/gdb/community/build/gdb/corefile-qu= it > hello world > > Breakpoint 1, main (argc=3D > During symbol reading, incomplete CFI data; unspecified registers (e.g., > eax) at 0x80483d2. > 1, argv=3D0xbffff544) at corefile-quit.c:15 > 15 =A0 =A0 =A0 =A0fault_func (ptr); > (gdb) set ptr=3D"new" > (gdb) cont > Continuing. > > Program exited normally. > (gdb) quit > ../../git/gdb/inferior.c:362: internal-error: find_inferior_pid: Assertion > `pid !=3D 0' failed. > A problem internal to GDB has been detected, > further debugging may prove unreliable. > Quit this debugging session? (y or n) n > ../../git/gdb/inferior.c:362: internal-error: find_inferior_pid: Assertion > `pid !=3D 0' failed. > A problem internal to GDB has been detected, > further debugging may prove unreliable. > Create a core file of GDB? (y or n) n > > -- > Edjunior Barbosa Machado > IBM Linux Technology Center >