This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: skip __main
- From: Daniel Jacobowitz <drow at false dot org>
- To: Pedro Alves <pedro_alves at portugalmail dot pt>
- Cc: Pierre Muller <muller at ics dot u-strasbg dot fr>, gdb-patches <gdb-patches at sourceware dot org>
- Date: Thu, 31 Jan 2008 18:01:32 -0500
- Subject: Re: skip __main
- References: <479EB897.5030603@portugalmail.pt>
On Tue, Jan 29, 2008 at 05:24:39AM +0000, Pedro Alves wrote:
> Hi all, Pierre,
>
> Here's the much smaller patch I mentioned at gdb@.
>
> This version is about as small as it can get. First the
> prologue is analysed and skipped, then line info is used
> to get at the first line of user code in the function. If
> the function is called "main" (humm, I shall move that into
> the callback, as I believe the place where __main/__gccmain
> is emitted is configurable on the gcc side), call a gdbarch
> method that skips the __main call. Works OK as long as nothing
> is scheduled into before the __main call. That means that it
> should work OK at -O0, which is enough for fixing the
> runto_main problems in the testsuite. Then again,
> debugging code with .stabs debug info at anything but -O0
> is not pleasant anyway.
>
> Last time I looked at the results, it uncovered other
> more serious problems, so it was a win just for that fact.
>
> I'm starting an overnight testrun on Cygwin, as the
> last time I did that was a couple of months back.
>
> Any comments? Suggestions for a better gdbarch
> callback name?
This patch looks fine to me, though I would like to hear what Mark
Kettenis thinks of it first.
gdbarch_skip_main_constructor_call might be better? The three
underscores just mean we'll never spell it right.
--
Daniel Jacobowitz
CodeSourcery