Re: 'b ::new' causes gdb 8.1 to coredump ?

Simon Marchi <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.