This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: 'b ::new' causes gdb 8.1 to coredump ?
- From: Simon Marchi <simon dot marchi at polymtl dot ca>
- To: Jason Vas Dias <jason dot vas dot dias at gmail dot com>
- Cc: gdb at sourceware dot org
- Date: Sat, 21 Apr 2018 18:52:36 -0400
- Subject: Re: 'b ::new' causes gdb 8.1 to coredump ?
- References: <4lk4tj1i.fsf@gmail.com> <zi1ws2eu.fsf@gmail.com>
On 2018-04-21 16:57, Jason Vas Dias wrote:
Aha! It was the '::' namespace colons!
(gdb) b "operator new(std::size_t)"
Breakpoint 2 at 0x155554c30680: file
../../../../gcc-gcc-7-branch/libstdc++-v3/libsupc++/new_op.cc, line
43.
(gdb) q
But I don't think the presence or absence of leading global namespace
'::' colons should cause GDB to coredump or fail to resolve operator
new() .
Doesn't GDB understand C++ namespaces ?
GDB does understand namespaces, just try "b std::string::find" for
example.
Maybe it's my knowledge of C++ that is lacking, but I don't think
'operator ::new' is right. It would be like writing 'operator ::+'. So
(gdb) b 'operator new'
sounds right to me. This:
(gdb) b '::operator new'
should probably work too (not sure), since you could have other
operators in namespaces (foo::operator==(hello&, hello&)), but it also
hits the assert. In any case, no input should ever hit an assert, so
it's still a bug (it should be cleanly rejected).
Simon