BkkBonanza
April 26th, 2011, 10:32 AM
I'm trying to setup for remote debugging and need some input from somebody more experienced with doing this as I'm getting confusing results.
I have a program I want to run in a Ubuntu VBox guest and I want to debug it from the host. I have been able to do the basic steps of running the program under gdbserver on the guest and connect to it to debug from the host. eg.
(guest) gdbserver 192.168.56.3:9999 test
(host) gdb test
I have compiled the test program on both systems and have the source on both. When I start gdb I can debug the local program with no problems. When I try to debug the remote one with "target remote 192.168.56.3:9999 test" it does connect and work as well.
However, when I set a breakpoint it will never stop for it. eg. my test program is extremely simple, just a loop of output a string and input a char. I set a "break 10" to stop in the loop. But when I switch to the guest and enter a char it works as usual and never breaks. When debugged locally it does break of course.
If I use an "until 10" command it will run until I enter a char and then break. But it breaks at a weird address and seems to not know where it is. The "info source" command states that my test.cpp source is loaded but the debugger appears not to know where it has stopped. It cannot see local vars. and eg. I get this response to a step:
(gdb) step
Cannot find bounds of current function
Any ideas? I thought maybe there was differences in library versions linked against but ldd shows same version, though at different paths. The systems are slightly different Ubuntu versions lucid vs. maverick.
I can't really continue in setting up for a more complex situation until I van get basic break functionality in this simple case.
(yes, program is compiled with -g debug symbols on host)
I have a program I want to run in a Ubuntu VBox guest and I want to debug it from the host. I have been able to do the basic steps of running the program under gdbserver on the guest and connect to it to debug from the host. eg.
(guest) gdbserver 192.168.56.3:9999 test
(host) gdb test
I have compiled the test program on both systems and have the source on both. When I start gdb I can debug the local program with no problems. When I try to debug the remote one with "target remote 192.168.56.3:9999 test" it does connect and work as well.
However, when I set a breakpoint it will never stop for it. eg. my test program is extremely simple, just a loop of output a string and input a char. I set a "break 10" to stop in the loop. But when I switch to the guest and enter a char it works as usual and never breaks. When debugged locally it does break of course.
If I use an "until 10" command it will run until I enter a char and then break. But it breaks at a weird address and seems to not know where it is. The "info source" command states that my test.cpp source is loaded but the debugger appears not to know where it has stopped. It cannot see local vars. and eg. I get this response to a step:
(gdb) step
Cannot find bounds of current function
Any ideas? I thought maybe there was differences in library versions linked against but ldd shows same version, though at different paths. The systems are slightly different Ubuntu versions lucid vs. maverick.
I can't really continue in setting up for a more complex situation until I van get basic break functionality in this simple case.
(yes, program is compiled with -g debug symbols on host)