Page 1 of 1

tracing program: breakpoints

Posted: Sun Jul 13, 2008 1:43 pm
by varnie
good day, eranif.

don't know what i am doing wrong but being debugging with CodeLite IDE i cannot break on specified marked as breakpoint lines. suppose, i have the following code sample:
main.cpp:

Code: Select all

#include "MyClass.h"

int main(){
  //...
  MyClass c;
  c.invoke();
  return 0;
}
where MyClass is implemented in MyClass.h file:

Code: Select all

class MyClass{
public:
  //...
  void invoke(){ printf("hello\n");}  <-- *i set breakpoint on this line*
};
i press F5 and CodeLite IDE doesn't stop on marked line in MyClass.h file. it just executes my program and properly finishes it.
keeping in mind this 'odd' behavior described above, i have to set "additional" breakpoint in main.cpp file just *before* c.invoke() line so i'll be breaked in it and after i debug my program step by step pressing F11/F10. this approach works well, but i wonder why i cannot break in specified line located in "MyClass.h" directly? thanks for information.

Re: tracing program: breakpoints

Posted: Sun Jul 13, 2008 2:05 pm
by eranif
Hi,
This is a known issue with gdb and placing berakpoints inside header files.

Try to add implementation fie MyFile.cpp and move the function 'invoke()' to it.

Now placing a breakpoint at that 'invoke()' will work.

Eran