From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27487 invoked by alias); 22 Jun 2010 20:03:48 -0000 Received: (qmail 27358 invoked by uid 22791); 22 Jun 2010 20:03:47 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e24smtp03.br.ibm.com (HELO e24smtp03.br.ibm.com) (32.104.18.24) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 Jun 2010 20:03:40 +0000 Received: from mailhub3.br.ibm.com (mailhub3.br.ibm.com [9.18.232.110]) by e24smtp03.br.ibm.com (8.14.4/8.13.1) with ESMTP id o5MJqSTE003424 for ; Tue, 22 Jun 2010 16:52:28 -0300 Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.8.31.91]) by mailhub3.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o5MK8EpU1343732 for ; Tue, 22 Jun 2010 17:08:14 -0300 Received: from d24av01.br.ibm.com (loopback [127.0.0.1]) by d24av01.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o5MH3avv029728 for ; Tue, 22 Jun 2010 14:03:36 -0300 Received: from [9.18.235.114] (dyn531377.br.ibm.com [9.18.235.114]) by d24av01.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id o5MH3aMJ029714; Tue, 22 Jun 2010 14:03:36 -0300 Message-ID: <4C211717.60505@linux.vnet.ibm.com> Date: Tue, 22 Jun 2010 20:03:00 -0000 From: Edjunior Barbosa Machado User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100411 Lightning/1.0b1 Icedove/3.0.4 MIME-Version: 1.0 To: Michael Snyder CC: "gdb-patches@sourceware.org" Subject: Re: [PATCH] Quit after debugging corefiles References: <1277212708-11125-1-git-send-email-emachado@linux.vnet.ibm.com> <4C20F60C.5060409@vmware.com> In-Reply-To: <4C20F60C.5060409@vmware.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg00489.txt.bz2 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') before, which is permitted in the current version (although I noticed this behavior has been discussed in the thread that Pedro previously mentioned). You can see the full output below. Sorry if it was unclear in the beginning. Using the following faulty code: $ cat -n corefile-quit.c 1 #include 2 3 static void 4 fault_func (char *arg) 5 { 6 *arg = 0; /* segfault */ 7 } 8 9 int main (int argc, char *argv[]) 10 { 11 char *ptr = NULL; 12 13 printf("hello world\n"); 14 15 fault_func (ptr); 16 17 return 0; 18 } $ ./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 0x080483ca in fault_func (arg=0x0) at corefile-quit.c:6 6 *arg = 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]) [answered N; input not from terminal] Function "info_command" not defined. Make breakpoint pending on future shared library load? (y or [n]) [answered 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-quit hello world Breakpoint 1, main (argc= During symbol reading, incomplete CFI data; unspecified registers (e.g., eax) at 0x80483d2. 1, argv=0xbffff544) at corefile-quit.c:15 15 fault_func (ptr); (gdb) set ptr="new" (gdb) cont Continuing. Program exited normally. (gdb) quit ../../git/gdb/inferior.c:362: internal-error: find_inferior_pid: Assertion `pid != 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 != 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