'b ::new' causes gdb 8.1 to coredump ?
Jason Vas Dias <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <[email protected]> |
I was just debugging a noddy C++ test program,
(Linux x86_64: g++ 5.4.0, glibc-2.27, binutils-2.30, gdb-8.1 )
and tried:
Temporary breakpoint 1, main (argc=1, argv=0x7fffffffd828, envp=0x7fffffffd838) at test/tTuple.C:75
75 { MyT t;
(gdb) b ::new
cp-namespace.c:177: internal-error: block_symbol cp_lookup_bare_symbol(const language_defn*, const char*, const block*, domain_enum, int): Assertion `strstr (name, "::") == NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)
Please answer y or n.
cp-namespace.c:177: internal-error: block_symbol cp_lookup_bare_symbol(const language_defn*, const char*, const block*, domain_enum, int): Assertion `strstr (name, "::") == NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) n
This is a bug, please report it. For instructions, see:
<http://www.gnu.org/software/gdb/bugs/>.
cp-namespace.c:177: internal-error: block_symbol cp_lookup_bare_symbol(const language_defn*, const char*, const block*, domain_enum, int): Assertion `strstr (name, "::") == NULL' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) n
Command aborted.
(gdb) b ::new(std::size_t)
Function "::new(std::size_t)" not defined.
(gdb) b operator ::new(size_t)
Function "operator ::new(size_t)" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n
(gdb) b operator ::new(std::size_t)
Function "operator ::new(std::size_t)" not defined.
Make breakpoint pending on future shared library load? (y or [n]) n
Is there something I'm not getting or does gdb's C++ symbol handling
leave alot to be desired ?
How to set a breakpoint at the ONE definition @ :
/usr/include/c++/5.4.0/new @ line 98 :
} // namespace std
...
void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
__attribute__((__externally_visible__));
(END QUOTE)
This symbol has the fully qualified name 'operator ::new::(std::size_t)' -
so I think GDB should be able to mangle and look it up this name in
libstdc++, especially as it has the '__externally_visible__' attribute.
Why can't it ?
I think on 'b ::new' , if on a terminal, gdb should present a list of matches for
::new(.*) , and allow user to select which to break at . Would this be
too difficult to implement ?
Thanks & Best Regards,
Jason