This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Failed breakpoint for C++ in gdb
- From: Alain Magloire <alain at qnx dot com>
- To: gdb at sources dot redhat dot com
- Date: Tue, 26 Jul 2005 09:31:10 -0400
- Subject: Failed breakpoint for C++ in gdb
Why is gdb so fussy about the argument order ?
For example:
int foo(const char *p) {
int i = 0;
i++;
return i;
}
int foo() {
int y = 0;
y += 2;
return y;
}
int main(int argc, char **argv) {
Const char *p = "foobar";
foo(p);
foo();
Return 0;
}
(gdb) b foo(const char *)
Function "foo(const char *)" not defined
(gdb) b foo(char const *)
Breakpoint 1 at 0x....... file testing.cpp line 4.
So is there something I should do ? Do I have to reorder my arguments to put
the const last ?
??