I tried to find this question on the Internet, but it seems that I can not find a good solution for my problem. Well, I'm trying to use gdb to debug my C ++ program. And the program consists of simple main.cpp and model.h. And the compilation team
g++ -Wall -g -c main.cpp g++ -Wall -g main.o -o OUTPUT
As almost the entire algorithm is stored in model.h, I need to debug this header file, not the cpp file. However, whenever I tried to place a breakpoint in the header, for example
tbreak model.h:163
gdb always gives me a message that "There is no source file named TNFmodel.h".
In another checkpoint question in GDB, I saw a solution by adding a folder containing the header to the library using "dir". But my header file is already in the source folder and after trying
dir ./
The problem persists.
So does anyone know what happened? How to use gdb to debug the header file?
c ++ debugging header gdb
Chong
source share