This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix problem with scope.exp test, skipping past init0 call
- From: "Jim Blandy" <jimb at red-bean dot com>
- To: "Michael Snyder" <msnyder at redhat dot com>
- Cc: "Mark Kettenis" <mark dot kettenis at xs4all dot nl>, fnf at specifix dot com, drow at false dot org, gdb-patches at sourceware dot org
- Date: Wed, 1 Mar 2006 22:09:12 -0800
- Subject: Re: [PATCH] Fix problem with scope.exp test, skipping past init0 call
- References: <200602121510.01657.fnf@specifix.com> <200602131047.30428.fnf@specifix.com> <200602131604.k1DG4n9Y025733@elgar.sibelius.xs4all.nl> <200602131118.49981.fnf@specifix.com> <200602131648.k1DGmUqx009322@elgar.sibelius.xs4all.nl> <8f2776cb0602130947s56ed2f8bs3b66049e8e4c89a3@mail.gmail.com> <440635D0.1050704@redhat.com>
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.