Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: gdb-patches@sourceware.org
Subject: Re: [RFC] symtab.c: Change skip_prologue_sal comparison to match main() too
Date: Wed, 21 Mar 2012 22:08:00 -0000	[thread overview]
Message-ID: <20120321150804.61acc01e@mesquite.lan> (raw)
In-Reply-To: <20120314090228.GA13802@host2.jankratochvil.net>

On Wed, 14 Mar 2012 10:02:28 +0100
Jan Kratochvil <jan.kratochvil@redhat.com> wrote:

> 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.

While it wasn't really designed to test this case, gdb.cp/koenig.exp
does provide a test as the resulting failures are due to not executing
everything up to the first line in the body of main().

If you wanted a more direct test, all that's needed is to place a
breakpoint in main() in a C++ program and make sure that this
breakpoint ends up being placed on the first line of the function
body.

Kevin


  reply	other threads:[~2012-03-21 22:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-13 22:58 Kevin Buettner
2012-03-13 23:25 ` Pedro Alves
2012-03-14  9:02   ` Jan Kratochvil
2012-03-21 22:08     ` Kevin Buettner [this message]
2012-03-21 22:01 ` Kevin Buettner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120321150804.61acc01e@mesquite.lan \
    --to=kevinb@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox