Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: graceful unwind termination when we'd need unavailable/uncollect memory or registers to unwind further
Date: Mon, 28 Feb 2011 15:42:00 -0000	[thread overview]
Message-ID: <20110228154132.GA7881@host1.dyn.jankratochvil.net> (raw)
In-Reply-To: <201102221834.42413.pedro@codesourcery.com>

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=<unavailable>) 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  <unavailable> 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 <unavailable>.  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 <http://gnu.org/licenses/gpl.html>
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:
<http://www.gnu.org/software/gdb/bugs/>...
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:}


  reply	other threads:[~2011-02-28 15:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-22 18:35 Pedro Alves
2011-02-28 15:42 ` Jan Kratochvil [this message]
2011-02-28 15:56   ` Pedro Alves
2011-02-28 18:50     ` Jan Kratochvil
2011-03-18 20:21 ` Pedro Alves
2011-03-21 10:09 ` Regression: " Jan Kratochvil
2011-03-21 20:46   ` Pedro Alves
2011-03-22 14:40   ` Pedro Alves
2011-03-22 15:36     ` Jan Kratochvil
2011-03-22 16:19       ` Pedro Alves
2011-03-21 17:46 ` [commit] Fix tramp-frame.c crash (Re: graceful unwind termination when we'd need unavailable/uncollect memory or registers to unwind further) Ulrich Weigand
2011-03-21 20:52   ` Pedro Alves
2011-03-31 14:43 ` [rfc] Fix broken i386 signal unwinding " Ulrich Weigand
2011-03-31 16:20   ` Pedro Alves
2011-03-31 16:23     ` [rfc] Fix broken i386 signal unwinding (Re: graceful unwind termination when we'd need unavailable/uncollect memory or regis Ulrich Weigand

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=20110228154132.GA7881@host1.dyn.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    /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