Re: gdbserver "load" command

Venkata Subbarao
2010-05-20T14:08:01Z

Thank you very much.

--Subbarao

On Tue, May 18, 2010 at 8:51 PM, Pedro Alves <pedro@codesourcery.com> wrote:
> 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
>