I have to debug a program with gdb. This program is compiled with debug options with gcc. My problem is that the sources are not in the same machine I use to debug and run this program. I can't use remote gdb debugging. Is there a way to now the line/file location when advancing in gdb? Is there some other solutions for this problem?
Thanks
You can debug it with the assembly code.
objdump -d shows all the contents. Then run gdb with break atmain function, and ni to run the next instruction(assembly). Oh, don't forget to enable display $pc will help you.
The above advice is only for toy code.
If you have installed IDA(and the plugin), you can use its restore to C code function.
If you are experiencing a segmentation fault, you may use core dump on linux machine by enabling it
ulimit -c unlimited
then transfer the core dump file to the other machine where you've got the source and run gdb with coredump file to identify where in the code you are getting the segmentation fault.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With