This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]