tracing program: breakpoints

General questions regarding the usage of CodeLite
varnie
CodeLite Veteran
Posts: 64
Joined: Wed Jun 11, 2008 3:48 am
Contact:

tracing program: breakpoints

Post 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.
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: tracing program: breakpoints

Post 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
Make sure you have read the HOW TO POST thread
Post Reply