This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/1245: cp-support.c:332: internal-error: cp_entire_prefix_len


>Number:         1245
>Category:       c++
>Synopsis:       cp-support.c:332: internal-error: cp_entire_prefix_len
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 18 20:58:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Stephane Carrez
>Release:        2003-06-17-cvs
>Organization:
>Environment:
i686-pc-linux-gnu
>Description:
gdb crashes when loading the symbols of a C++ program.
(it was working very well before, ie gdb 5.3).

It crashes when it sees the symbol:

__lt__H3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0_RCt12basic_string3ZX01ZX11ZX21T0_b

which corresponds to:

bool operator<<char, string_char_traits<char>, __default_alloc_template<true, 0> >(basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> > const &, basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> > const &)

The original C++ program was compiled by gcc 2.95.4
(on debian).  The '<' operator is from the STL.

GNU gdb 2003-06-17-cvs
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) b main
cp-support.c:332: internal-error: cp_entire_prefix_len: Assertion `name[current_len] == ':'' failed.
A problem internal to GDB has been detected.  Further
debugging may prove unreliable.
Quit this debugging session? (y or n) n
Create a core file of GDB? (y or n) n
(gdb) quit

>How-To-Repeat:
The gdb-bug.cpp just creates the faulty symbol. It must
be compiled by c++ compiler (2.95 or 3.3).

g++ -o gdb-bug -g gdb-bug.cpp
gdb gdb-bug
(gdb) b main


>Fix:
David,

the problem is due to the fact that the operator function
is '<' and not '<<'. The second '<' is the beginning of
a template instantiation.  This is wierd because you have
no way (to my knowledge) to distinguish between:

operator < <template instance>
operator << 

Since the second < is eat by the operator processing,
we come up with a wrong result. Ideally, the demangler
should insert a space after the operator <

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="gdb-bug.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="gdb-bug.cpp"

LyogCiBib29sIG9wZXJhdG9yPDxjaGFyLCBzdHJpbmdfY2hhcl90cmFpdHM8Y2hhcj4sIF9fZGVm
YXVsdF9hbGxvY190ZW1wbGF0ZTx0cnVlLCAwPiA+KGJhc2ljX3N0cmluZzxjaGFyLCBzdHJpbmdf
Y2hhcl90cmFpdHM8Y2hhcj4sIF9fZGVmYXVsdF9hbGxvY190ZW1wbGF0ZTx0cnVlLCAwPiA+IGNv
bnN0ICYsIGJhc2ljX3N0cmluZzxjaGFyLCBzdHJpbmdfY2hhcl90cmFpdHM8Y2hhcj4sIF9fZGVm
YXVsdF9hbGxvY190ZW1wbGF0ZTx0cnVlLCAwPiA+IGNvbnN0ICYpCiAqLwpleHRlcm4gIkMiIHsK
ICAKdm9pZCBfX2x0X19IM1pjWnQxOHN0cmluZ19jaGFyX3RyYWl0czFaY1p0MjRfX2RlZmF1bHRf
YWxsb2NfdGVtcGxhdGUyYjFpMF9SQ3QxMmJhc2ljX3N0cmluZzNaWDAxWlgxMVpYMjFUMF9iKCkK
ewp9Cn0KCmludCBtYWluKCkKewogIHJldHVybiAwOwp9Cgo=


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]