This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdbserver and the gdb "load" command for remote target


Hi All, 

I have question on how to use the gdb "load" command
with the gdbserver for remote target debugging: 

I am trying to do remote debugging from a host machine
to a x86 target. Both of them are running the latest
version of Linux. On the target I ran gdbserver using
the command: "gdbserver testprogram#1
192.168.1.1:2345". 

testprogram#1 is the program that I have transferred
to the target using FTP. 192.168.1.1 is the IP address
of the host. On the host I ran gdb. I used the
"extended remote 192.168.1.2:2345" gdb command to
connect to the target and I was able to set
breakpoints and everything went well.

I have one problem. I want to be able to dynamically
be able to load new test program to the target using
gdb. Assuming I don't have the executable for the test
program already stored in the target (for example, I
want to test a new testprogram#2), can I use gdb to
transfer it to the target and debug it? And after
loading it, what is the command to use to instruct the
gdbserver to run this program?

I have used the "load" command with in gdb to load
testprogram#2 to the test target, and gdb seemed to be
loading/transferring the file, however once the "load"
command finished executing, I don't know how to tell
the gdbserver to dynamically run testprogram#2. 

I used the "run" and "file" commands, and I was not
successful to debug testprogram#2 remotely. When I
type "run" gdb command in the host, the gdbserver will
run testprogram#1, and not testprogram#2.

Gdbserver only knows about the testprogram#1, and I
don't know how to tell it to run testprogram#2 which I
loaded to the target using the "load" command.

When invoking the server program, it requires the name
of the program to debug, and it seems that you can not
at later time try to load (or change to) a different
program than the originally given to gdbserver? If
this is true, then the gdb "load" command is not very
useful.

I hope that my question is clear.

Thank you for any help,

Best regards,

Mike


__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]