Author Topic: How to make the program stop at the breakpoints set in the header file?  (Read 2936 times)

joshua8541

  • Guest
I defined a function func(int x, int y) in a header file(.h).
In the main function (.c file) , the breakpoints work well. I set one where the function "func" is called and the program stopped there, then I stepped into and it does go into "func". However, I can only hit "next line". if I use "continue" or "run to cursor", the program will go through "func" and back to main function. So I will never inspect the variables in the function "func" in the header file.

Can someone tell me what's going on?
Thanks

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
You didn't give the environment.
 
This kind of question has asked several times in this forum. You can search on this forum.

AFAIK, at lest, TDM-MinGW didn't have this problem.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.