Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Joel Brobecker <brobecker@adacore.com>
Cc: Andrew Cagney <cagney@gnu.org>, gdb-patches@sources.redhat.com
Subject: Re: [RFC] Infinite backtraces...
Date: Fri, 03 Dec 2004 22:23:00 -0000	[thread overview]
Message-ID: <20041203221524.GA15030@nevyn.them.org> (raw)
In-Reply-To: <20041203215745.GL16491@adacore.com>

On Fri, Dec 03, 2004 at 01:57:45PM -0800, Joel Brobecker wrote:
> > >Reviewing the code that does the backtrace, I don't see how this
> > >would work. We're at the oldest frame, trying to unwind from it.
> > >So we compute its ID, and then create the previous frame.
> > 
> > Which ID, this or prev?
> 
> We create the ID of this frame. Then create the previous frame.
> 
> I think I'm starting to see how I was confused.  Going back to my
> initial example, we have:
> 
>     #0  simple.break_me () at simple.adb:27
>     #1  0x0000a2cc in simple.caller (<_task>=0x4001c3a0) at simple.adb:21
>     #2  0x0000a268 in simple__callerB___2 () at simple.adb:18
>     #3  0x00017184 in system.tasking.stages.task_wrapper ()
>     #4  0x00017058 in system__tasking__stages__task_wrapper ()
>     #5  0x7aee0f60 in __pthread_create_system () from /usr/lib/libpthread.1
>     #6  0x7aee0f08 in __pthread_create_system () from /usr/lib/libpthread.1
>     #7  0x00000000 in ?? ()
> 
> Imagine we are at frame #6, and try to go up one frame. So what happens
> is that we compute the ID of frame #6, and then, assuming all the sanity
> checks are ok, create frame #7.
> 
> What you are suggesting is that we return a null frame ID for frame
> #6, correct? What I thought you were saying is that we return a null
> frame ID for frame *7*, which of course should never exist.

I'd suggest that you return a null frame ID from frame *5* actually.
Is there a reason not to do that?  Certainly a bit of caution is called
for, but if GDB has the knowledge that a particular bit of code can
never be backtraced through...

There's an equivalent function in the glibc thread libraries 
for starting a thread, which should never be backtraced through.  Note
that we can't do a similar thing for clone unless the target's library
provides a symbol distinct from clone to use; we have to be able to
backtrace from clone itself.

-- 
Daniel Jacobowitz


  reply	other threads:[~2004-12-03 22:16 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-02 22:46 Joel Brobecker
2004-12-02 23:13 ` Joel Brobecker
2004-12-03  2:43   ` Randolph Chung
2004-12-03  2:57     ` Joel Brobecker
2004-12-03  4:53       ` Randolph Chung
2004-12-03 19:36         ` Joel Brobecker
2004-12-03 18:03           ` Randolph Chung
2004-12-03 18:20             ` Joel Brobecker
2004-12-03 18:22               ` Randolph Chung
2004-12-06  7:25               ` Randolph Chung
2004-12-07 10:07                 ` Joel Brobecker
2004-12-07 16:31                   ` Randolph Chung
2004-12-07 16:37                     ` Joel Brobecker
2004-12-07 16:52                       ` Randolph Chung
2004-12-08  1:51                       ` Randolph Chung
2004-12-12 16:36                         ` [commit] Move zero PC check to frame.c; Was: " Andrew Cagney
2004-12-03 18:22           ` Joel Brobecker
2004-12-06  4:15           ` Randolph Chung
2004-12-07  9:40             ` Joel Brobecker
2004-12-03 18:28 ` Andrew Cagney
2004-12-03 18:49   ` Joel Brobecker
2004-12-03 19:26     ` Andrew Cagney
2004-12-03 20:19       ` Joel Brobecker
2004-12-03 21:44         ` Andrew Cagney
2004-12-03 22:16           ` Joel Brobecker
2004-12-03 22:23             ` Daniel Jacobowitz [this message]
2004-12-03 22:25               ` Joel Brobecker

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=20041203221524.GA15030@nevyn.them.org \
    --to=drow@false.org \
    --cc=brobecker@adacore.com \
    --cc=cagney@gnu.org \
    --cc=gdb-patches@sources.redhat.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