On Tue, Jan 5, 2016 at 12:38 PM, Artemiy Volkov <artem...@acm.org> wrote:
> On Tue, Jan 05, 2016 at 07:26:36AM -0800, Ian Lance Taylor wrote:
>
>> If gdb is using the code in cplus-dem.c in any way for a program
>> compiled in the last 15 years, then gdb is doing something horribly
>> wrong.  What function is gdb calling that makes your patch make a
>> difference?
>
> This is what I'm doing, just the ordinary use of the demangle command...
>
> ➜ gdb gdb/gdb
> GNU gdb (GDB) 7.10.1
> Copyright (C) 2015 Free Software Foundation, Inc.
> [snip]
> (top-gdb) b cplus-dem.c:3636
> Breakpoint 3 at 0x8cf598: file ../../binutils-gdb/libiberty/cplus-dem.c,
> line 3636.
> (top-gdb) r
> Starting program: /home/w41/gdb-build/gdb/gdb
> [snip]
> (gdb) demangle -l c++ -- __20DisplayList_IteratorO11DisplayList
>
> Breakpoint 3, do_type (work=0x7fffffffdf40, mangled=0x7fffffffded0,
> result=0x11622b0) at ../../binutils-gdb/libiberty/cplus-dem.c:3636
> 3636                type_quals = TYPE_UNQUALIFIED;
> (top-gdb) bt
> #0  do_type (work=0x7fffffffdf40, mangled=0x7fffffffded0,
> result=0x11622b0) at ../../binutils-gdb/libiberty/cplus-dem.c:3636
> #1  0x00000000008d0b5c in do_arg (work=0x7fffffffdf40,
> mangled=0x7fffffffded0, result=0x7fffffffdde0)
>     at ../../binutils-gdb/libiberty/cplus-dem.c:4231
> #2  0x00000000008d1350 in demangle_args (work=0x7fffffffdf40,
> mangled=0x7fffffffded0, declp=0x7fffffffdee0)
>     at ../../binutils-gdb/libiberty/cplus-dem.c:4514
> #3  0x00000000008cb79a in demangle_signature (work=0x7fffffffdf40,
> mangled=0x7fffffffded0, declp=0x7fffffffdee0)
>     at ../../binutils-gdb/libiberty/cplus-dem.c:1665
> #4  0x00000000008ca778 in internal_cplus_demangle (work=0x7fffffffdf40,
> mangled=0xdf5132 "O11DisplayList")
>     at ../../binutils-gdb/libiberty/cplus-dem.c:1203
> #5  0x00000000008c9e0c in cplus_demangle (mangled=0xdf511a
> "__20DisplayList_IteratorO11DisplayList", options=3)
>     at ../../binutils-gdb/libiberty/cplus-dem.c:886
> #6  0x00000000007f2af0 in bfd_demangle (abfd=0x0, name=0xdf511a
> "__20DisplayList_IteratorO11DisplayList", options=3)
>     at ../../binutils-gdb/bfd/bfd.c:1917
> #7  0x0000000000781795 in gdb_demangle (name=0xdf511a
> "__20DisplayList_IteratorO11DisplayList", options=3)
>     at ../../binutils-gdb/gdb/cp-support.c:1571
> #8  0x0000000000695474 in language_demangle (current_language=0x9c0180
> <cplus_language_defn>,
>     mangled=0xdf511a "__20DisplayList_IteratorO11DisplayList",
> options=3) at ../../binutils-gdb/gdb/language.c:651
> #9  0x00000000006a9189 in demangle_command (args=0xdf61a9 "-l c++ --
> __20DisplayList_IteratorO11DisplayList", from_tty=1)
>     at ../../binutils-gdb/gdb/demangle.c:218
> #10 0x0000000000507d64 in do_cfunc (c=0xeb1710, args=0xdf61a9 "-l c++ --
> __20DisplayList_IteratorO11DisplayList", from_tty=1)
>     at ../../binutils-gdb/gdb/cli/cli-decode.c:105
> #11 0x000000000050ad01 in cmd_func (cmd=0xeb1710, args=0xdf61a9 "-l c++
> -- __20DisplayList_IteratorO11DisplayList", from_tty=1)
>     at ../../binutils-gdb/gdb/cli/cli-decode.c:1885
> #12 0x0000000000769272 in execute_command (p=0xdf61d8 "t", from_tty=1)
> at ../../binutils-gdb/gdb/top.c:475
> #13 0x00000000006558c7 in command_handler (command=0xdf61a0 "demangle -l
> c++ -- __20DisplayList_IteratorO11DisplayList")
>     at ../../binutils-gdb/gdb/event-top.c:491
> #14 0x0000000000655e80 in command_line_handler (rl=0x1161910 "demangle
> -l c++ -- __20DisplayList_IteratorO11DisplayList")

Where is the symbol "__20DisplayList_IteratorO11DisplayList" coming from?

As far as I know no current C++ compiler will generate such a symbol.

Ian

Reply via email to