tracing program: breakpoints

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

tracing program: breakpoints

Post by varnie » Sun Jul 13, 2008 1:43 pm

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:

Code: Select all

#include "MyClass.h"

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

Code: Select all

class MyClass{
  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
CodeLite Plugin
Posts: 5983
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++

Re: tracing program: breakpoints

Post by eranif » Sun Jul 13, 2008 2:05 pm

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.

Make sure you have read the HOW TO POST thread

Post Reply