Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: drow@false.org
Cc: pedro_alves@portugalmail.pt, gdb-patches@sourceware.org
Subject: Re: [PATCH] i386_skip_prologue.
Date: Sat, 30 Dec 2006 21:21:00 -0000	[thread overview]
Message-ID: <200612302120.kBULKqOJ031833@brahms.sibelius.xs4all.nl> (raw)
In-Reply-To: <20061230204826.GD25539@nevyn.them.org> (message from Daniel 	Jacobowitz on Sat, 30 Dec 2006 15:48:26 -0500)

> Date: Sat, 30 Dec 2006 15:48:26 -0500
> From: Daniel Jacobowitz <drow@false.org>
> 
> On Sat, Dec 09, 2006 at 08:32:00PM +0000, Pedro Alves wrote:
> > The i386 targets currently don't look at line number markers
> > or the symbol table at all in i386_skip_prologue.
> > 
> > I used the attached patch to test the gcc side of the fix,
> > (http://gcc.gnu.org/ml/gcc-patches/2006-12/msg00633.html)
> > 
> > With the gcc patch above applied, this patch fixes all the runto_main issues
> > on Cygwin. There are a few other FAILs related to breakpoints and main,
> > but those are testsuite bugs, unrelated to this. I will send patches for 
> > those shortly.
> 
> As this is an i386-specific change, I'd been hoping Mark Kettenis could
> take a look at it.  Mark, any opinion on this?

I'm sorry.  I tend to suffer from packet loss at my side.

> We've been going back and forth on prologue skipping choices for a long
> time now.  We have at least four options, each with at least two users:
> 
>   - skip_prologue_using_sal
>   - refine_prologue_limit
>   - this simple approach using line numbers, i.e. what you did
>   - sticking to analysis of the instructions
> 
> Aside from how difficult the analysis is, there's very little target
> dependent about this.  It's a shame we've got so many different ways
> to do it.

Yes, that's my general feeling.  But last time I brought it up, we
didn't reach a real conclusion.

> Is there a general philosophy we could adopt that would apply to most
> or all targets?
> 
> Here's a proposal to get us started: when skipping the prologue to
> place a breakpoint or finish single stepping (skip_prologue), try to
> skip to the end of the first sal.  But some targets may optionally run
> their prologue analyzer and make sure it doesn't see anything it
> objects to - like jumps.  That would mean the i386 prologue analyzer
> would need to know about this new call to __main.  When scanning the
> prologue to build frame unwind information, ignore sals entirely.
> Scan until we hit the saved PC or until we believe we understand
> the entire frame.

The last time I tried using sals on i386, I simply encountered too
many cases where the line number information couldn't be trusted and
putting a breakpoint on a function that was defenitely called never
hit.


  reply	other threads:[~2006-12-30 21:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <455EE79E.6000109@portugalmail.pt>
     [not found] ` <uveldatp9.fsf@gnu.org>
     [not found]   ` <455EF845.40902@portugalmail.pt>
     [not found]     ` <455F2754.5060703@portugalmail.pt>
     [not found]       ` <20061118163738.GA14800@nevyn.them.org>
2006-12-09 20:32         ` Pedro Alves
2006-12-30 20:48           ` Daniel Jacobowitz
2006-12-30 21:21             ` Mark Kettenis [this message]
2006-12-30 21:31               ` Daniel Jacobowitz

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=200612302120.kBULKqOJ031833@brahms.sibelius.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro_alves@portugalmail.pt \
    /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