Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* 'b ::new' causes gdb 8.1 to coredump ?
@ 2018-04-21 20:57 Jason Vas Dias
  2018-04-21 22:52 ` Jason Vas Dias
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Vas Dias @ 2018-04-21 20:57 UTC (permalink / raw)
  To: gdb


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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-21 22:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-21 20:57 'b ::new' causes gdb 8.1 to coredump ? Jason Vas Dias
2018-04-21 22:52 ` Jason Vas Dias
2018-04-23  0:59   ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox