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] Fix problem with scope.exp test, skipping past init0 call


On 3/1/06, Michael Snyder <msnyder@redhat.com> wrote:
> Jim Blandy wrote:
> > Actually, having seen other's responses here, I'm inclined to say that
> > the proper fix is to simply drop the code in scope.exp for getting
> > from the opening brace to the first line.  Setting a breakpoint on
> > main simply shouldn't leave you on the opening brace, and that test
> > suite logic has always been papering over a bug.
> >
> > If prologues contain calls to __main, then the prologue analyzers
> > should skip them.
>
> Are you sure?  If skipping __main involves overhead,
> do you want to incur that overhead every time we want
> to skip a prologue?

Do you mean overhead in the analysis of the prologue to find its end,
or overhead in allowing the program to continue to the end of a
prologue that contains a call to __main?

If the first, I don't think it's a big deal.  If we don't see a jsr,
we won't incur any overhead.

If the second, the skip_prologue gdbarch method gets used in the
following situations:

- When we're stepping into a function.  Here, we use the step-resume
breakpoint to step when we get to the end of the prologue, so there's
no overhead that I see to skipping over __main.  We're not
single-stepping over the call.

- When we're setting a breakpoint at a function start.  Obviously, no
special run-time overhead here; you can set the breakpoint anywhere
you like.

- When we're trying to decide if a given address is in a prologue. 
Again, I don't see any impact.

I think this is a correctness issue anyway, not a performance issue. 
If a prologue contains a call to __main, it's our job to make sure
that works efficiently; we shouldn't change the behavior of
skip_prologue.


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