Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Troy Rollo <troy@rollo.com>
To: Daniel Berlin <dan@cgsoftware.com>
Cc: gdb-patches@sourceware.cygnus.com
Subject: Re: Borland TDS reading + BFD Interface Change
Date: Thu, 24 Aug 2000 03:36:00 -0000	[thread overview]
Message-ID: <4.3.1.2.20000822192249.00dbe870@mail> (raw)
In-Reply-To: <Pine.LNX.4.21.0008192109460.1354-100000@propylaea.anduin.com>

At 21:14 19/08/00 -0700, Daniel Berlin wrote:
>libiberty's demangler module provides a generic interface to demangling
>any c++ symbol.
>
>You should be able to add any type of demangler into it, no matter how
>dissimilar.

I actually started off by trying to slot it into cplus-dem.c, but based on 
a quick look at the code I have, which only seems to handle GNU, LUCID, 
ARM, HP and EDG, which all seem to be using basically the same scheme, the 
TDS stuff couldn't be integrated in except at the very top level. I didn't 
think it would be appropriate to hook Borland demangling into 
cplus_demangle or internal_cplus_demangle when it's really only useful for 
one platform.

The approach I took instead was to make sure that every symbol that could 
be demangled was demangled when the symbols were read in.

If I hook into cplus_demangle or internal_cplus_demangle, there are other 
problems to overcome:

1. Borland changed the mangling scheme between TDS version 9 (BC++4.x) and 
TDS version 10 (BC++5.x). Unfortunately, there isn't even a reliable way to 
tell which mangling scheme is in use just from the symbol, so it would 
require either two enum values for the different schemes, or a willingness 
to forgo TDS version 9 (which is probably reasonable since it's primarily 
the free beer  compiler that of most interest).

2. Because Borland partially mangles many of its symbols, we'd have to 
substitute fully mangled symbols at read in time so the demangler could 
correctly demangle them. This is feasible, although it's something I was 
hoping to avoid - although there's one bonus to be had from that in that 
the interaction with c_type_print could be removed.

>It makes it amazingly difficult to do useful C++ debugging if your
>demangler must be called seperately. We need to simply be able to use
>cplus_demangle, and get the right stuff back, no matter what the mangling
>scheme used is.

That's why I demangled everything at the time of reading symbols - I 
thought I might avoid the need to call cplus_demangle but it sounds like 
that's not enough.

Assuming you want to go the route of ditching TDS version 9 and fully 
mangling the symbols at symbol read time so they can be reliably demangled, 
how should the hook into cplus_demangle or internal_cplus_demangle be made? 
I'm assuming this needs to be done in such a way that platforms that don't 
need it don't have to have it.
______________________________________________________________________________
troy@rollo.com				         Troy Rollo, Sydney, Australia
       Fight spam in Australia - Join CAUBE.AU - http://www.caube.org.au/



           reply	other threads:[~2000-08-24  3:36 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <Pine.LNX.4.21.0008192109460.1354-100000@propylaea.anduin.com>]

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=4.3.1.2.20000822192249.00dbe870@mail \
    --to=troy@rollo.com \
    --cc=dan@cgsoftware.com \
    --cc=gdb-patches@sourceware.cygnus.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