This is the mail archive of the gdb-patches@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: [RFA/RFC] mips tracepoint: fix Bug 12013


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.
>
> 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 "";


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