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: What role does gdb/remote.c play?


Thank you very much.

Then, if I want to create a new remote target, should I just modify
remote.c or reuse codes in it? How do I map command 'target remote' to
the new target I created?

It seems I did what those documents told me to, but things don't work.

Best wishes.

å 2011å8æ15æ äå6:09ïPedro Alves <pedro@codesourcery.com> åéï
> On Monday 15 August 2011 10:08:28, yongyong.yang@ia.ac.cn wrote:
>> Hey, everyone.
>>
>> Recently I am trying to port gdb for a remote target. I use remote-m32r-sdi as start point.
>> when I debug it, I find the global variable current_target has the value specified in remote.c,
>> furthermore I find the generated file init.c has both initialize_XXX() and _initialize_remote() ,
>> where XXX is the target I specified for my target.
>>
>> So when I run command 'target remote localhost:[port]', it is remote_open() that handles the argument and etc.
>>
>> Can someone explain what is wrong. Thank you.
>
> GDB supports more than one method to talk to the remote target.
> To connect to a remote target using remote-m32r-sdi.c, you issue
> "target m32rsdi". ÂSee:
>
> $ grep "to_shortname = " src/gdb/remote*.c
> remote.c: Âremote_ops.to_shortname = "remote";
> remote.c: Âextended_remote_ops.to_shortname = "extended-remote";
> remote-m32r-sdi.c: Âm32r_ops.to_shortname = "m32rsdi";
> remote-mips.c: Âmips_ops.to_shortname = "mips";
> remote-mips.c: Âpmon_ops.to_shortname = "pmon";
> remote-mips.c: Âddb_ops.to_shortname = "ddb";
> remote-mips.c: Ârockhopper_ops.to_shortname = "rockhopper";
> remote-mips.c: Âlsi_ops.to_shortname = "lsi";
> remote-sim.c: Âgdbsim_ops.to_shortname = "sim";
>
> "target remote" maps to remote.c, which uses the
> GDB Remove Serial Protocol (RSP, see the GDB manual) to control
> target. ÂNew targets are strongly encouraged to
> implement RSP support on the remote end, instead of cooking up a
> new gdb remote backend.
>
> --
> Pedro Alves
>


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