Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: Andrew Cagney <ac131313@redhat.com>
Cc: Michal Ludvig <mludvig@suse.cz>,
	GDB Patches <gdb-patches@sources.redhat.com>
Subject: Re: [RFA] Artifical dwarf2 debug info
Date: Mon, 16 Dec 2002 11:13:00 -0000	[thread overview]
Message-ID: <20021216185750.GA24656@nevyn.them.org> (raw)
In-Reply-To: <3DFE1ECD.5080908@redhat.com>

On Mon, Dec 16, 2002 at 01:43:25PM -0500, Andrew Cagney wrote:
> INIT_FRAME_EXTRA_INFO() can throw an error.  For instance, due to an 
> attempt to read from an address specified by PC/FP/SP when that address 
> is invalid.  For such cases, there should still be a current frame (so 
> that `info registers' works) but it shouldn't unwind any further.
> 
> So again, yes, you'll end up with current-frame -> regs-frame.

OK, I follow you now.  Hmm...

> >>>As for this situation, and the similar one for i386... there are three
> >>>unwind functions, to find the previous frame's registers, ID, and PC.
> >>>For this case we just want to express a normal function call which
> >>>saves no registers; pretty easy.  But for i386 I'll want to express
> >>>something which initially pushes a register, and then does some work,
> >>>pops it, and does more work before returning.
> >
> >>
> >>So you're proposing that the saved-regs code be used to generate a cfi 
> >>description as well?
> >>
> >>Interesting.
> >
> >
> >Precisely.  When given a function without enough information to
> >backtrace through it in the debug info, the prologue scanner could
> >implement this new method in order to provide backtraces.  It could
> >really clear up some messes.
> >
> >I think it's a promising idea.
> 
> Need to figure out how/were this should tie into the rest of the frame 
> structure.  The CFI code is not exactly integrated into the mainstream.
> 
> Here, the key function is get_prev_frame() where GDB first unwinds the 
> PC and then uses that to determine what is needed to unwind/create the 
> rest of the frame.  It could easily read:
> 
> 	if (pc in dummy-frame)
> 	  create dummy frame;
> 	else if (pc in cfi frame)
> 	  create cfi frame;
> 	else if (pc in something else)
> 	  create some other frame;
> 
> or even:
> 
> 	while (frame in known unwind types)
> 	  if (frame and pc match)
> 	    return create that frame;
> 
> that is, a target will support a number of frame types, each identified 
> using the PC.

If I'm scanning this code correctly, all we would need to do would be
to connect set_unwind_by_pc to the CFI machinery.  No, it's more
complicated than that, we still call both FRAME_CHAIN and frame_pc_unwind;
I'm not entirely clear on how frame_saved_regs_id_unwind works. 
Similarly in get_prev_frame.

But what I'd like to see is something like you've sketched above. 
Probably check first for dummy frame, then for sigtramp frame, then for
CFI frame, and then fall back to the defaults.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


  reply	other threads:[~2002-12-16 18:56 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-14 17:31 Michal Ludvig
2002-12-14 22:53 ` Eli Zaretskii
2002-12-15 11:03 ` Daniel Jacobowitz
2002-12-16  7:28   ` Michal Ludvig
2002-12-16  7:49     ` Daniel Jacobowitz
2002-12-16  9:27       ` Michal Ludvig
2002-12-16  9:54         ` Daniel Jacobowitz
2002-12-16 10:38         ` Eli Zaretskii
2002-12-20  8:43           ` Michal Ludvig
2002-12-20 10:51             ` Eli Zaretskii
2002-12-16  9:25 ` Andrew Cagney
2002-12-16  9:40   ` Daniel Jacobowitz
2002-12-16 10:04     ` Andrew Cagney
2002-12-16 10:17       ` Daniel Jacobowitz
2002-12-16 10:56         ` Andrew Cagney
2002-12-16 11:13           ` Daniel Jacobowitz [this message]
2002-12-16 11:34             ` Andrew Cagney
2002-12-16 11:57               ` Daniel Jacobowitz
2002-12-16 12:10                 ` Andrew Cagney
2002-12-16 12:42                   ` Daniel Jacobowitz
2002-12-17  6:23                     ` Michal Ludvig
2002-12-17  6:28                       ` Andrew Cagney
2002-12-17  8:42                         ` Daniel Jacobowitz
2002-12-18  4:39                           ` Andrew Cagney
2002-12-18 10:05                             ` Daniel Jacobowitz
2003-01-02 20:54                               ` Andrew Cagney
2003-01-02 21:19                                 ` Daniel Jacobowitz
2003-01-02 23:05                                   ` Andrew Cagney
2003-01-02 23:27                                     ` Daniel Jacobowitz
2003-01-03  0:28                                       ` Andrew Cagney
2002-12-16  9:46   ` Michal Ludvig
2002-12-16  9:57     ` Andrew Cagney
2002-12-16 10:01       ` Michal Ludvig

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=20021216185750.GA24656@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=ac131313@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=mludvig@suse.cz \
    /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