Re: Failed breakpoint for C++ in gdb

Daniel Jacobowitz
2005-07-29T15:29:05Z

On Fri, Jul 29, 2005 at 11:20:07AM -0400, Alain Magloire wrote:
> (gdb) b String::check(int) const
> Function "String::check(int)" not defined.
> Make breakpoint pending on future shared library load? (y or [n]) n
> (gdb) b "String::check(int) const"
> Function "String::check(int)" not defined.
> Make breakpoint pending on future shared library load? (y or [n]) n
> (gdb) b 'String::check(int) const'
> Breakpoint 1 at 0x4015bc: file 100992.cpp, line 150.
>
> I'm curious to know why ("") double quotes are not working, but single quote
> seems to do the job. This is particular disturbing in the MI protocol where
> it is clearly stated options/arguments containing spaces must be surrounded
> with double quotes.

Because the string is passed directly to the command line symbol name
parser, and it treats single quotes specially. Really, you have to
read linespec.c to figure out what it's doing.

Basically, with the single quotes, you're getting a minimal symbol from
the ELF symbol table. The others are trying for debug info lookups and
having some problem.

> Anyway just curious, this was sent by the folks from MontaVista 8-). It is
> too late for the front to deal with it, but for the next version, is this PR
> (bugzilla/gnats) material?

I suppose so; but no one's working in this area, so it's more likely
patch material :-)