5

For some reason I can't get gdb to recognize the files in my project when debugging. I've tried a variety of things, including downloading different version, etc. and the last thing I did was completely overwrite all of MingW with Twilight Dragon Media's Bundle Package.

Does anyone know how to solve this issue? The odd thing was that when I first started using it, it was working fine, and then it suddenly stopped working.

I'm using Code::Blocks and I have the -g checked for the debug version of the project. I'm running on Windows Vista.

1 Answer 1

12

GDB locates source files by file path/name from the object module debug information. So if you moved your sources you should rebuild your project. This can also happen if you are running on a different host which has no visibility to your source at all.

The most important thing to remember is:

  • Debug information doesn't contain the source itself, but only the path where to find it. People often don't know this.
Sign up to request clarification or add additional context in comments.

2 Comments

So in a remote debug situation w/ gdbserver, how does one inform gdb of the local base directory for file locations?
Good question, this answer is 12 years ago :-) - but I think principle is the same - local client folders should match debug information that is used. In case of the answer I really was using this but here I cannot check now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.