bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PR 270 gdb/270


From: Carlo Wood
Subject: Re: PR 270 gdb/270
Date: Thu, 10 Jan 2002 01:00:12 +0100
User-agent: Mutt/1.2.5i

On Wed, Jan 09, 2002 at 03:32:45PM +0300, Vladimir Prus wrote:
> I've traced down this problem to a bug in the demangler that is part of 
> binutils/libiberty. See
> http://sources.redhat.com/ml/bug-binutils/2002-q1/msg00021.html
> 
> Regards,
> Vladimir

Thanks.

I wrote a patch for this (see attachment).  Hopefully it can be applied
before the next release of gdb.

A few notes: While the intention might have been to only generate
integral numbers in the form: <digit> or _<digit><digit>[<digit>...]_
gcc (old ABI) DOES generate multi-digit numbers without underscores
for integer template parameters.

The bug was triggered by the fact that (broken into seperate lines for
readability):

_t13_Alloc_traits2Zt12basic_string3ZcZt18string_char_traits1ZcZQ45libcw
5debug9_private_t17allocator_adaptor3ZcZt24__default_alloc_template
2b0i327664b1ZQ45libcw5debug9_private_t17allocator_adaptor3Zt12basic_string
3ZcZt18string_char_traits1ZcZQ45libcw5debug9_private_t17allocator_adaptor
3ZcZt24__default_alloc_template2b0i327664b1Zt24__default_alloc_template
2b0i327664b1._S_instanceless

which should demangle to:

_Alloc_traits<basic_string<char, string_char_traits<char>,
libcw::debug::_private_::allocator_adaptor<char,
__default_alloc_template<false, 327664>, true> >,
libcw::debug::_private_::allocator_adaptor<basic_string<char,
string_char_traits<char>,
libcw::debug::_private_::allocator_adaptor<char,
__default_alloc_template<false, 327664>, true> >,
__default_alloc_template<false, 327664>, true> >::_S_instanceless

contains the string 'i327664b1' which was is decoded as an integer '3'
followed by something with length 27664.

By fixing the fact that all digits should be read, the core dump is
solved too.

The testsuite did contain two test cases that now failed, but these
test cases weren't realistic: gcc never generates those mangled names.

For example:

f(Bar<2>, XY_t)

is mangled as f__FGt3Bar1i2G4XY_t by gcc, and not as f__FGt3Bar1i24XY_t
as was contained in the testsuite (note the extra 'G').

-- 
Carlo Wood <address@hidden>

Attachment: dem.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]