debugging - GDB source path - Stack Overflow
linux - How to open a source file in GDB - Stack Overflow
GDB "no source available"
How to include files in gdb ?
Videos
I FINALLY found out how to do this in cgdb:
- Press Esc to go to the code window.
- Press Alt-O.
- Scroll down to the source file you want to open and press Enter.
Now you can set breakpoints in this file.
I have the same problem; it's amazing that such a basic function is so obscure. My workaround is to use the file name and function name to set the breakpoint:
b <filename>:<function name>
Hey, I'm a Comp Eng student and I've been recently introduced to GDB in my assembly class, and while I think as a tool it has very good practical uses, I seem to be unable to use it properly. My teacher gives us weekly assignments that are based on tests, and for each test passed correctly you score 1 point. Now, when trying to debug with GDB as soon as I get to the "printf("Test"....)" that prints my program's result and compares it to the correct result, the print also appears in the GDB debugger command like (aka where I type), therefore bugging it out and subsequently turning the code screen to "No Source Available". Any help?
https://imgur.com/a/110wc7S this is before the printf
https://imgur.com/a/CEOsL67 this is after the printf