This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] symtab.c: Change skip_prologue_sal comparison to match main() too
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Kevin Buettner <kevinb at redhat dot com>
- Cc: gdb-patches at sourceware dot org, Keith Seitz <keiths at redhat dot com>, Pedro Alves <palves at redhat dot com>
- Date: Wed, 14 Mar 2012 10:02:28 +0100
- Subject: Re: [RFC] symtab.c: Change skip_prologue_sal comparison to match main() too
- References: <20120313155817.44b4f280@mesquite.lan> <4F5FD74B.1090500@redhat.com>
On Wed, 14 Mar 2012 00:24:59 +0100, Pedro Alves wrote:
> I'm going to guess this is fallback from physname. The code looked like
> this when it was originally added:
>
> + /* On targets with executable formats that don't have a concept of
> + constructors (ELF with .init has, PE doesn't), gcc emits a call
> + to `__main' in `main' between the prologue and before user
> + code. */
> + if (funfirstline
> + && gdbarch_skip_main_prologue_p (current_gdbarch)
> + && SYMBOL_LINKAGE_NAME (sym)
> + && strcmp (SYMBOL_LINKAGE_NAME (sym), "main") == 0)
>
> And SYMBOL_LINKAGE_NAME (sym) used to be "main" for C++ too.
This is:
regression by physname: PE32 prologue skip vs. static initializers
http://sourceware.org/bugzilla/show_bug.cgi?id=12680
I would welcome also a testcase, though.
Thanks,
Jan