Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Hui Zhu <teawater@gmail.com>
To: Kevin Buettner <kevinb@redhat.com>,
	Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA/RFC] mips tracepoint: fix Bug 12013
Date: Mon, 27 Dec 2010 13:20:00 -0000	[thread overview]
Message-ID: <AANLkTi=4KDzEGrUfODei-aSvDpOq4hVTG9N_Tw17AaeU@mail.gmail.com> (raw)
In-Reply-To: <AANLkTi=BP5vy2w7C3PHWKa8M2Gv==hip8Kd53Wq+B=iz@mail.gmail.com>

On Thu, Dec 23, 2010 at 10:57, Hui Zhu <teawater@gmail.com> wrote:
> On Wed, Dec 22, 2010 at 23:36, Kevin Buettner <kevinb@redhat.com> wrote:
>> On Wed, 22 Dec 2010 15:12:22 +0800
>> Hui Zhu <teawater@gmail.com> wrote:
>>
>>> > You might consider implementing a new gdbarch method which provides a
>>> > mapping from pseudo register numbers to raw register numbers. __The
>>> > trace machinery could use such a mapping to find the corresponding raw
>>> > register(s) when presented with a pseudo register. __I can think of
>>> > several potential pitfalls with this approach, but I think the idea is
>>> > worth exploring.
>>>
>>> Thanks Kevin.  I will do it.
>>
>> Please look at Pedro's reply.  He has outlined a better approach.
>>
>>> And I make a patch to add some comments from your mail to mips_register_name.
>>> Wish it can help other people.
>>>
>>> Please help me review it.
>>
>> Okay, see below...
>>
>>> 2010-12-22  Hui Zhu  <teawater@gmail.com>
>>>
>>>       * mips-tedp.c (mips_register_name): Add comments.
>>>
>>> ---
>>>  mips-tdep.c |    7 ++++++-
>>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>>
>>> --- a/mips-tdep.c
>>> +++ b/mips-tdep.c
>>> @@ -454,7 +454,12 @@ mips_register_name (struct gdbarch *gdba
>>>    enum mips_abi abi = mips_abi (gdbarch);
>>>
>>>    /* Map [gdbarch_num_regs .. 2*gdbarch_num_regs) onto the raw registers,
>>> -     but then don't make the raw register names visible.  */
>>> +     but then don't make the raw register names visible.
>>> +     Because It is possible to debug a 64-bit device using a 32-bit programming
>>> +     model.  In such instances, the raw registers are configured to be
>>> +     64-bits wide, while the pseudo registers are configured to be 32-bits
>>> +     wide.  The registers that the user sees - the pseudo registers - match
>>> +     the user's expectations given the programming model being used.  */
>>
>> Could you revise the comment to read as follows?
>>
>>    /* Map [gdbarch_num_regs .. 2*gdbarch_num_regs) onto the raw registers,
>>       but do not make the raw register names visible.  This (upper)
>>       range of user visible register numbers are the
>>       pseudo-registers.
>>
>>       This approach was adopted accomodate the following scenario:
>>       It is possible to debug a 64-bit device using a 32-bit
>>       programming model.  In such instances, the raw registers are
>>       configured to be 64-bits wide, while the pseudo registers are
>>       configured to be 32-bits wide.  The reigsters that the user
>>       sees - the pseudo registers - match the users expectations
>>       given the programming model being used.  */
>>
>> Please allow several days for others to tweak my suggested wording.  If
>> there are no further comments on the above wording, feel free to commit
>> it.

Checked in.

Joel,  do you think this patch can check in to 7.2.1.

Thanks,
Hui

>>
>> Thanks,
>>
>> Kevin
>>
>
> OK.   Thanks Kevin.
>
> Best,
> Hui
>
>
> 2010-12-23  Kevin Buettner  <kevinb@redhat.com>
>            Hui Zhu  <teawater@gmail.com>
>
>        * mips-tedp.c (mips_register_name): Add comments.
>
> ---
>  mips-tdep.c |   11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> --- a/mips-tdep.c
> +++ b/mips-tdep.c
> @@ -454,7 +454,16 @@ mips_register_name (struct gdbarch *gdba
>   enum mips_abi abi = mips_abi (gdbarch);
>
>   /* Map [gdbarch_num_regs .. 2*gdbarch_num_regs) onto the raw registers,
> -     but then don't make the raw register names visible.  */
> +     but then don't make the raw register names visible.  This (upper)
> +     range of user visible register numbers are the pseudo-registers.
> +
> +     This approach was adopted accommodate the following scenario:
> +     It is possible to debug a 64-bit device using a 32-bit
> +     programming model.  In such instances, the raw registers are
> +     configured to be 64-bits wide, while the pseudo registers are
> +     configured to be 32-bits wide.  The registers that the user
> +     sees - the pseudo registers - match the users expectations
> +     given the programming model being used.  */
>   int rawnum = regno % gdbarch_num_regs (gdbarch);
>   if (regno < gdbarch_num_regs (gdbarch))
>     return "";
>


  reply	other threads:[~2010-12-27  8:20 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-19  8:36 Hui Zhu
2010-12-19 10:39 ` Mark Kettenis
2010-12-19 12:16   ` Hui Zhu
2010-12-21 14:45     ` Hui Zhu
2010-12-21 14:58       ` Mark Kettenis
2010-12-21 15:09         ` Hui Zhu
2010-12-21 15:42     ` Kevin Buettner
2010-12-21 15:59       ` Hui Zhu
2010-12-22  6:04         ` Kevin Buettner
2010-12-22  7:12           ` Hui Zhu
2010-12-22 16:20             ` Kevin Buettner
2010-12-23  3:33               ` Hui Zhu
2010-12-27 13:20                 ` Hui Zhu [this message]
2010-12-27 13:56                   ` Joel Brobecker
2010-12-28  4:43                     ` Hui Zhu
2010-12-22 11:27           ` Pedro Alves
2010-12-25 19:10             ` Hui Zhu
2010-12-27 13:52               ` Pedro Alves
2010-12-28  9:52                 ` Hui Zhu
2010-12-28 10:30                   ` Pedro Alves
2010-12-28 17:09                     ` Hui Zhu
2010-12-28 18:04                       ` Joel Brobecker
2010-12-28 19:05                         ` Pedro Alves
2010-12-28 19:07                           ` Pedro Alves
2010-12-29  8:10                             ` Hui Zhu
2010-12-29 13:06                               ` Pedro Alves
2010-12-29 16:09                                 ` Hui Zhu
2010-12-29 17:57                                   ` Pedro Alves
2010-12-30  8:00                                     ` Hui Zhu

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='AANLkTi=4KDzEGrUfODei-aSvDpOq4hVTG9N_Tw17AaeU@mail.gmail.com' \
    --to=teawater@gmail.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.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