This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Mangle question
- To: Mike Stump <mrs at windriver dot com>
- Subject: Re: Mangle question
- From: Carlo Wood <carlo at alinoe dot com>
- Date: Tue, 29 Aug 2000 11:58:53 +0200
- Cc: carlo at alinoe dot com, gcc at gcc dot gnu dot org
- References: <200008282306.QAA19106@kankakee.wrs.com>
On Mon, Aug 28, 2000 at 04:06:06PM -0700, Mike Stump wrote:
> digit. Then a customer had a testcase with 12 or so of them. By have
> it done this way, we preserve backward and forwards compatibility for
> 99% of the code (<10 of something), and by having _[0-9]+/[^0-9] for
> the new case, we then can have any number (literally) of somethings
> going forward.
Thanks Mike, but in this case it isn't _[0-9]+/[^0-9], you are
using [0-9]+_[^0-9]. The underscore is on the other side of the
digits :/. For example: "...T9c..." but "...T10_c..."
It already occured to me that perhaps the idea was to use "...T_10c..."
but that is just not the case. Could this indeed be a "bug"?
Anyway as I said, it doesn't matter. Especially not since we're
moving to another mangling sheme.
Regards,
... O wait. I promised to give two bugs I found in the current
demangler. Ok...
1) destructors are demangled as: foobar::~foobar(void)
that should be foobar::~foobar() !
2) *every* class name (of the form <digits><class-name>) can be
prepended by an underscore in order to seperate it from a
previous digit in a way that is not predictable. There can
no special circumstances reasonably be given. Therefore, you
must always check for an underscore when reading <digits> and
eat it when it is there. This is not done by the current
demangler, which is why it fails to demangle certain constructs.
For example:
__vc__Q2t12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0_3RepUi
^
unexpected seperator __|
The demangler I wrote over the weekend makes of this:
basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> >::Rep::operator[](unsigned int)
When I get time to move to the new abi myself, I'll have to write a
demangler for that one too -- be sure that I'll run torture tests on
the new abi too then and will come up with new bugs ;). I suppose
nobody feels like fixing the above for the old abi.
Regards,
--
Carlo Wood <carlo@alinoe.com> -=- Jesus Loves you -=-