This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] i386_skip_prologue.


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?

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.

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.

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]