This is the mail archive of the gdb@sourceware.org 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]

Re: gdbserver "load" command


On Tuesday 18 May 2010 16:05:17, Venkata Subbarao wrote:
> Sorry, But how can I run without loading the file.

You don't need to, and shouldn't use load when debugging
an unix like process.  "load" only makes sense for embedded
debugging --- it copies the program straight into the target's
memory.  When debugging on linux, or full blown OS, you want to 
create a new process, and that's what "run" does.

> I have tried with "remote put" and I have succeeded with it.

That's good.  After that, tell gdbserver which program to run
with "(gdb) set remote exec-file myprog".  Then you can just
type "run" to launch a new process, just like you were
debugging natively.

If you instead start gdbserver like so:

 $ gdbserver :9999 myprog

gdbserver will start the myprog program for you; This means
there'll already by a process running when you connect with
gdb.

> But I
> wanted to use "load" followed by "continue" command.

Don't.

> I am also curious to know what actually happens when we say "load"
> command. Where does it dump the file contents ?

To the debuggee/`inferior process' memory.  It doesn't make much sense
to use "load" when debugging a unix-like process.

-- 
Pedro Alves


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