From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24807 invoked by alias); 28 Feb 2011 15:41:51 -0000 Received: (qmail 24798 invoked by uid 22791); 28 Feb 2011 15:41:50 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 28 Feb 2011 15:41:45 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p1SFfZFw028494 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 28 Feb 2011 10:41:35 -0500 Received: from host1.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p1SFfXSt021855 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 28 Feb 2011 10:41:35 -0500 Received: from host1.dyn.jankratochvil.net (localhost [127.0.0.1]) by host1.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p1SFfXnF025436; Mon, 28 Feb 2011 16:41:33 +0100 Received: (from jkratoch@localhost) by host1.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id p1SFfW9U025431; Mon, 28 Feb 2011 16:41:32 +0100 Date: Mon, 28 Feb 2011 15:42:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: graceful unwind termination when we'd need unavailable/uncollect memory or registers to unwind further Message-ID: <20110228154132.GA7881@host1.dyn.jankratochvil.net> References: <201102221834.42413.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201102221834.42413.pedro@codesourcery.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2011-02/txt/msg00901.txt.bz2 On Tue, 22 Feb 2011 19:34:42 +0100, Pedro Alves wrote: > This teaches GDB about terminating unwinding gracefully if > unwind further we would need registers/memory that haven't > been collected. > > Here's the result: > > (gdb) bt > #0 begin (a=) at ../../../src/gdb/testsuite/gdb.trace/unavailable.cc:182 > #1 0x00000000004008ad in main (argc=1, argv=0x7fff0e22cf28, envp=0x7fff0e22cf38) > at ../../../src/gdb/testsuite/gdb.trace/unavailable.cc:210 > #2 in ?? () > Backtrace stopped: Not enough registers or memory available to unwind further In my case: (gdb) tfind 0 Found trace frame 0, tracepoint 2 #0 f () at 1.c:11 11 v++; (gdb) bt #0 f () at 1.c:11 Backtrace stopped: Not enough registers or memory available to unwind further (gdb) That is without that . I think it is a bug. Thanks, Jan $ ./gdb -nx -x ~/.gdbinit -ex 'target remote localhost:1234' ./gdbserver/1 -ex 'tb main' -ex c GNU gdb (GDB) 7.2.50.20110228-cvs Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu". For bug reporting instructions, please see: ... Reading symbols from /home/jkratoch/redhat/gdb-clean/gdb/gdbserver/1...done. Remote debugging using localhost:1234 Reading symbols from /lib64/ld-linux-x86-64.so.2...Reading symbols from /usr/lib/debug/lib64/ld-2.13.90.so.debug...done. done. Loaded symbols for /lib64/ld-linux-x86-64.so.2 0x00007fcc89596600 in _start () from /lib64/ld-linux-x86-64.so.2 Temporary breakpoint 1 at 0x4004aa: file 1.c, line 18. Continuing. Temporary breakpoint 1, main () at 1.c:18 18 f (); (gdb) trace 11 Tracepoint 2 at 0x400480: file 1.c, line 11. (gdb) actions Enter actions for tracepoint 2, one per line. End with a line saying just "end". >collect v >end (gdb) tstart (gdb) b b Breakpoint 3 at 0x400478: file 1.c, line 6. (gdb) c Continuing. Breakpoint 3, b () at 1.c:6 6 } (gdb) tstop (gdb) tstatus Trace stopped by a tstop command. Collected 9 trace frames. Trace buffer has 5242691 bytes of 5242880 bytes free (0% full). Trace will stop if GDB disconnects. Not looking at any trace frame. (gdb) tfind 0 Found trace frame 0, tracepoint 2 #0 f () at 1.c:11 11 v++; (gdb) bt #0 f () at 1.c:11 Backtrace stopped: Not enough registers or memory available to unwind further (gdb) $ ./gdbserver :1234 ./1 Process ./1 created; pid = 20703 Listening on port 1234 Remote debugging from host 127.0.0.1 1:int v = 1; 2:int q = 1; 3:void 4:b (void) 5:{ 6:} 7:int 8:f (void) 9:{ 10: while (v < 10) 11: v++; 12: b (); 13: return 5; 14:} 15:int 16:main (void) 17:{ 18: f (); 19: return 0; 20:}