public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Michael Eager <eager@eagerm.com>
To: gdb-patches ml <gdb-patches@sourceware.org>
Cc: Keith Seitz <keiths@redhat.com>
Subject: Re: [PATCH] Regression setting breakpoint
Date: Fri, 31 Jan 2014 16:21:00 -0000	[thread overview]
Message-ID: <52EBCD9D.7030404@eagerm.com> (raw)
In-Reply-To: <52A8CD31.5090809@eagerm.com>

Ping.

Any comments?

On 12/11/13 12:38, Michael Eager wrote:
> There is a regression when setting a breakpoint which was introduced
> in gdb-7.3 by a fix in this patch:
> https://sourceware.org/ml/gdb-patches/2010-03/msg00220.html
>
> The regression shows up in C when the linkage name is different
> from the internal symbol name.  For example,
>
>     void goo (int b) asm("_goo");
>     void goo (int b) {}
>
> will create a function with the linkage name of "_goo" and the DWARF
> will describe the source name of "goo".  There is both a DW_AT_name and
> DW_AT_linkage_name in the DIE for this function.  Some compilers
> (e.g., ICC) have options allowing linkage names to have characters
> prepended to the source name so that the linkage name is different
> from the source name and can not be computed from it.
>
> Prior to this patch, a breakpoint at "_goo" would find the linkage
> symbol, and one at "goo" would find the source symbol.  After the
> patch, the source name is replace with the linkage name.
>
> The attached patch fixes this by making die_needs_namespace()
> return 0 for any C language program.  There's also a test case.
>
> I'm not sure that this is the right fix for the problem, although
> I'm pretty sure that it should not break anything.  There is code
> in dwarf2_compute_name() which only calls die_needs_namespace()
> for C++, Java, or Fortran programs, which could be moved into
> die_needs_namespace().  Possibly the fix should be in dwarf2_physname()
> where the call to die_needs_namespace() is done before the check for
> DW_AT_linkage_name is done.
>
> Comment:  Much of the code in dwarf2_compute_name(), dwarf2_physname(),
> and related functions seems complex, convoluted, and confusing (the
> big Three C's).  The source name for a symbol is not the same as
> the fully qualified name and it's not the same as the linkage name.
> That a language supports FQNs with namespaces does not seem to me
> to say that this should have anything to do with what the linkage (aka
> physical) name for the symbol is.
>


-- 
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077

      parent reply	other threads:[~2014-01-31 16:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11 20:38 Michael Eager
2014-01-16  5:22 ` Sergio Durigan Junior
2014-01-16  5:37   ` Joel Brobecker
2014-01-31 16:21 ` Michael Eager [this message]

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=52EBCD9D.7030404@eagerm.com \
    --to=eager@eagerm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@redhat.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).