From: Triple Yang <triple.yang@gmail.com>
To: gdb@sourceware.org
Cc: Pedro Alves <pedro@codesourcery.com>
Subject: Re: What role does gdb/remote.c play?
Date: Mon, 15 Aug 2011 15:10:00 -0000 [thread overview]
Message-ID: <CAGxstLRqEA0rBjdjDR8wiNYZ7YGY7QN4UTKhYC1tHbiKO9KmOg@mail.gmail.com> (raw)
In-Reply-To: <201108151432.33454.pedro@codesourcery.com>
2011/8/15 Pedro Alves <pedro@codesourcery.com>:
> On Monday 15 August 2011 12:51:11, Triple Yang wrote:
>
>> Then, if I want to create a new remote target, should I just modify
>> remote.c or reuse codes in it?
>
> I don't know what your new target does, so I can't answer that for you.
>
>> How do I map command 'target remote' to the new target I created?
>
> You don't. Do you _really_ need to implement a new target in gdb?
> Why not teach the remote end the RSP instead? Then you can
> use "target remote", without adding new code to gdb.
>
Yes, because I am trying porting GDB to a new architecture prototype.
Implementing a new target seems to be the only way to achieve the
purpose.
To "teach the remote end the RSP instead", what needs to be done?
>> It seems I did what those documents told me to, but things don't work.
>
> I'm confused. What documents? I only pointed you at the GDB manual,
> to check the RSP documentation. Here:
>
> http://sourceware.org/gdb/onlinedocs/gdb/Remote-Protocol.html
>
I have already read about those related codes and official documents.
I barely grasp the main points. Maybe I should dive into gdb source
codes. But I am not sure.
The Question is, when I created my own "struct target_ops" object and
initialized it properly, then added it to targetlist, I could expect
it would respond to commands like target remote and break.
As I've mentioned in a previous mail, current_target holds the value
specified in remote.c rather than my own remote-XXX.c. I guess the
expected value is overrided in init.c (which is a generated file
during building) since _initialize_remote() is called after calling
_initialize_remote_XXX(). It is easy to find an ugly and offensive way
to avoid that situation. But I tend to believe there are some clean
and pretty means to do that and I don't know yet.
Best wishes.
> --
> Pedro Alves
>
next prev parent reply other threads:[~2011-08-15 15:10 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
2011-08-15 13:32 ` Pedro Alves
2011-08-15 15:10 ` Triple Yang [this message]
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=CAGxstLRqEA0rBjdjDR8wiNYZ7YGY7QN4UTKhYC1tHbiKO9KmOg@mail.gmail.com \
--to=triple.yang@gmail.com \
--cc=gdb@sourceware.org \
--cc=pedro@codesourcery.com \
/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