From: Chris Moller <cmoller@redhat.com>
To: tromey@redhat.com
Cc: gdb-patches@sourceware.org
Subject: Re: pr9065 patch (the typeid thing)
Date: Mon, 22 Mar 2010 12:19:00 -0000 [thread overview]
Message-ID: <4BA76067.4060404@redhat.com> (raw)
In-Reply-To: <m3fx46cznk.fsf@fleche.redhat.com>
On 03/11/10 16:32, Tom Tromey wrote:
>
> Chris> Another difference is that the real typeid returns mangled names,
> Chris> leaving it to the user to demangle. This strikes me as a pain, so I
> Chris> just provide the demangled names.
>
> It should be compatible. GDB has a demangle command for this purpose.
>
>
I've done a lot of re-write on this patch over the last week or so, but
the requirement for returning mangled names turns out to be a bit of a
stopper: mangled names for built-in types don't exist at all in gdb,
and mangled names for symbols are only occasionally available.
My first thought was to clone the gcc mangler; my second thought was
that's not really the best solution. I don't know if it's intended for
gdb to be able to debug stuff compiled by anything other than gcc, but
since every compiler uses its own mangling algo, forcing the use of the
gcc mangling algo certainly wouldn't be compatible with that. Also,
though I don't know how likely it is, it's not impossible that the gcc
algo could change.
At least one of the probable reasons mangled symbol names aren't
available seems to be that they're not emitted in the DWARF. In my
testcase, of the dozen or so vars and fcns I use, the mangled name of
only one of them appears in the DWARF (tagged with
DW_AT_MIPS_linkage_name--why just that one symbol and nothing else, I
haven't a clue), so my guess is that if gcc could somehow be convinced
to emit the mangled names of all symbols and primitive types, things
would be cool, but I don't know how hard it would be to get gcc (i.e.,
its maintainers) to do that.. (I couldn't find a gcc option that made
that happen...)
Chris
prev parent reply other threads:[~2010-03-22 12:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-09 20:38 pr9065 patch Chris Moller
2010-03-10 4:11 ` Eli Zaretskii
2010-03-10 12:34 ` Chris Moller
2010-03-11 21:32 ` Tom Tromey
2010-03-12 14:22 ` Chris Moller
2010-03-22 12:19 ` Chris Moller [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=4BA76067.4060404@redhat.com \
--to=cmoller@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@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