public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Problems with MIPS disassembly and 'rdhwr' instruction...
@ 2005-08-29 12:13 Steven J. Hill
  2005-08-29 13:05 ` Monika Chaddha
  0 siblings, 1 reply; 6+ messages in thread
From: Steven J. Hill @ 2005-08-29 12:13 UTC (permalink / raw)
  To: gdb

Greetings.

I am trying to figure out how to get 'rdhwr' instructions to be
printed when doing a disassembly in gdb on MIPS binaries. My
binaries are not compiled as mips32r2, but as mips1. This is
allowable, but it appears that gdb in 'print_insn_mips' will not
decoded the 'rdhwr' the instruction because it is a mips1 binary?
I have spent a couple of hours trying to figure out the hashing
that is done in that function as well as hacking the loop and I
have come up with nothing. Can someone help me understand the
hashing better and suggest a method/patch to allow me to get the
'rdhwrd' instructions to print instead of the hex opcode? Thanks.

-Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Problems with MIPS disassembly and 'rdhwr' instruction...
  2005-08-29 12:13 Problems with MIPS disassembly and 'rdhwr' instruction Steven J. Hill
@ 2005-08-29 13:05 ` Monika Chaddha
  2005-08-29 13:20   ` Daniel Jacobowitz
  0 siblings, 1 reply; 6+ messages in thread
From: Monika Chaddha @ 2005-08-29 13:05 UTC (permalink / raw)
  To: 'Steven J. Hill'; +Cc: gdb

Hello,

As you have compiled GDB binary for MIPS1 target so it will support only
those instructions which come under MIPS1. In the disassembler table in
file 'src\opcodes\mips-op.c', there is last attribute membership which
is used to mention the architecture tag name. Here it will match the
membership of each instruction with MIPS1 membership name which I think
is I1 and defined as following in same file

#define I1	INSN_ISA1

If it matches then the instruction will be treated as MIPS1 instruction
for disassembly.

{"rdhwr",   "t,K",	0x7c00003b, 0xffe007ff, WR_t,		I33
},

As here I1 is not present in the above entry in last field so GDB is not
printing disassembly of this instruction. You need to just add
membership tag of MIPS1 in the required above opcode entry as following

{"rdhwr",   "t,K",	0x7c00003b, 0xffe007ff, WR_t,		I33|I1
},

Please try this. It should work.

Monika


>-----Original Message-----
>From: gdb-owner@sources.redhat.com
[mailto:gdb-owner@sources.redhat.com] On
>Behalf Of Steven J. Hill
>Sent: Monday, August 29, 2005 5:43 PM
>To: gdb@sources.redhat.com
>Subject: Problems with MIPS disassembly and 'rdhwr' instruction...
>
>Greetings.
>
>I am trying to figure out how to get 'rdhwr' instructions to be
>printed when doing a disassembly in gdb on MIPS binaries. My
>binaries are not compiled as mips32r2, but as mips1. This is
>allowable, but it appears that gdb in 'print_insn_mips' will not
>decoded the 'rdhwr' the instruction because it is a mips1 binary?
>I have spent a couple of hours trying to figure out the hashing
>that is done in that function as well as hacking the loop and I
>have come up with nothing. Can someone help me understand the
>hashing better and suggest a method/patch to allow me to get the
>'rdhwrd' instructions to print instead of the hex opcode? Thanks.
>
>-Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Problems with MIPS disassembly and 'rdhwr' instruction...
  2005-08-29 13:05 ` Monika Chaddha
@ 2005-08-29 13:20   ` Daniel Jacobowitz
  2005-08-29 13:46     ` Monika Chaddha
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2005-08-29 13:20 UTC (permalink / raw)
  To: Monika Chaddha; +Cc: 'Steven J. Hill', gdb

On Mon, Aug 29, 2005 at 06:36:43PM +0530, Monika Chaddha wrote:
> As here I1 is not present in the above entry in last field so GDB is not
> printing disassembly of this instruction. You need to just add
> membership tag of MIPS1 in the required above opcode entry as following
> 
> {"rdhwr",   "t,K",	0x7c00003b, 0xffe007ff, WR_t,		I33|I1
> },
> 
> Please try this. It should work.

It's not the right solution, though.  Steve, just try "set architecture
mips:mips32r2".

-- 
Daniel Jacobowitz
CodeSourcery, LLC

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Problems with MIPS disassembly and 'rdhwr' instruction...
  2005-08-29 13:20   ` Daniel Jacobowitz
@ 2005-08-29 13:46     ` Monika Chaddha
  2005-08-30  4:04       ` Steven J. Hill
  0 siblings, 1 reply; 6+ messages in thread
From: Monika Chaddha @ 2005-08-29 13:46 UTC (permalink / raw)
  To: 'Daniel Jacobowitz'; +Cc: 'Steven J. Hill', gdb

>-----Original Message-----
>From: Daniel Jacobowitz [mailto:drow@false.org]
>Sent: Monday, August 29, 2005 6:50 PM
>To: Monika Chaddha
>Cc: 'Steven J. Hill'; gdb@sources.redhat.com
>Subject: Re: Problems with MIPS disassembly and 'rdhwr' instruction...
>
>On Mon, Aug 29, 2005 at 06:36:43PM +0530, Monika Chaddha wrote:
>> As here I1 is not present in the above entry in last field so GDB is
not
>> printing disassembly of this instruction. You need to just add
>> membership tag of MIPS1 in the required above opcode entry as
following
>>
>> {"rdhwr",   "t,K",	0x7c00003b, 0xffe007ff, WR_t,		I33|I1
>> },
>>
>> Please try this. It should work.
>
>It's not the right solution, though.  Steve, just try "set architecture
>mips:mips32r2".
>
>--
>Daniel Jacobowitz
>CodeSourcery, LLC

Steve asked for the stable patch so I suggested this. Yes 'set
architecture' solution can be better solution and will work perfectly. 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Problems with MIPS disassembly and 'rdhwr' instruction...
  2005-08-29 13:46     ` Monika Chaddha
@ 2005-08-30  4:04       ` Steven J. Hill
  2005-08-30 12:11         ` Dave Korn
  0 siblings, 1 reply; 6+ messages in thread
From: Steven J. Hill @ 2005-08-30  4:04 UTC (permalink / raw)
  To: Monika Chaddha; +Cc: 'Daniel Jacobowitz', gdb

Thanks to you both. I am using the patch from Monika for my buildroot
system so that I do not have do the 'set architecture mips:mips32r2'.
Thank you Daniel for the clarification. I should have read the code a
bit more in depth. Cheers.

-Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: Problems with MIPS disassembly and 'rdhwr' instruction...
  2005-08-30  4:04       ` Steven J. Hill
@ 2005-08-30 12:11         ` Dave Korn
  0 siblings, 0 replies; 6+ messages in thread
From: Dave Korn @ 2005-08-30 12:11 UTC (permalink / raw)
  To: 'Steven J. Hill', 'Monika Chaddha'
  Cc: 'Daniel Jacobowitz', gdb

----Original Message----
>From: Steven J. Hill
>Sent: 30 August 2005 05:04

> Thanks to you both. I am using the patch from Monika for my buildroot
> system so that I do not have do the 'set architecture mips:mips32r2'.

  Of course, rather than patching the source code and rebuilding, you could
always just put that "set arch" command in your ~/.gdbinit file.


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-08-30 12:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-29 12:13 Problems with MIPS disassembly and 'rdhwr' instruction Steven J. Hill
2005-08-29 13:05 ` Monika Chaddha
2005-08-29 13:20   ` Daniel Jacobowitz
2005-08-29 13:46     ` Monika Chaddha
2005-08-30  4:04       ` Steven J. Hill
2005-08-30 12:11         ` Dave Korn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).