Failed breakpoint for C++ in gdb

Alain Magloire
2005-07-26T13:31:22Z

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 ?
??