Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Triple Yang <triple.yang@gmail.com>
To: gdb@sourceware.org
Subject: Re: What role does gdb/remote.c play?
Date: Mon, 15 Aug 2011 11:51:00 -0000	[thread overview]
Message-ID: <CAGxstLQC89a-kzVS8NoOaW_8+qAT5atxO9Oxc57Tna6kJMjWTw@mail.gmail.com> (raw)
In-Reply-To: <201108151109.56890.pedro@codesourcery.com>

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
>


  reply	other threads:[~2011-08-15 11:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-15  9:08 yongyong.yang
2011-08-15 10:10 ` Pedro Alves
2011-08-15 11:51   ` Triple Yang [this message]
2011-08-15 13:32     ` Pedro Alves
2011-08-15 15:10       ` Triple Yang
2011-08-15 15:26         ` Andrew Burgess
2011-08-15 17:48           ` Triple Yang
2011-08-15 15:28         ` Pedro Alves
     [not found]           ` <CAGxstLS4BjPZOatfSMMUiVNpOyd9gVzdVXbzqUqBzvb1M9gsjw@mail.gmail.com>
2011-08-15 17:54             ` Triple Yang
2011-08-15 15:46         ` Petr Hluzín
2011-08-15 18:20           ` Triple Yang
2011-08-15 20:13             ` Petr Hluzín

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGxstLQC89a-kzVS8NoOaW_8+qAT5atxO9Oxc57Tna6kJMjWTw@mail.gmail.com \
    --to=triple.yang@gmail.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox