qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] disas/hppa: drop raw opcode dump
@ 2024-02-29 14:05 Alex Bennée
  2024-02-29 15:02 ` Helge Deller
  2024-02-29 18:11 ` Richard Henderson
  0 siblings, 2 replies; 4+ messages in thread
From: Alex Bennée @ 2024-02-29 14:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alex Bennée, Richard Henderson

The hppa disassembly is different from the others due to leading with
the raw opcode data. This confuses plugins looking for instruction
prefixes to match instructions. For plugins like execlog there is
another mechanism for getting the instruction byte data.

For the sake of consistently just present the instruction assembly
code.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 disas/hppa.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/disas/hppa.c b/disas/hppa.c
index 22dce9b41bb..dd34cce211b 100644
--- a/disas/hppa.c
+++ b/disas/hppa.c
@@ -1972,10 +1972,6 @@ print_insn_hppa (bfd_vma memaddr, disassemble_info *info)
 
   insn = bfd_getb32 (buffer);
 
-  info->fprintf_func(info->stream, " %02x %02x %02x %02x   ",
-                (insn >> 24) & 0xff, (insn >> 16) & 0xff,
-                (insn >>  8) & 0xff, insn & 0xff);
-
   for (i = 0; i < NUMOPCODES; ++i)
     {
       const struct pa_opcode *opcode = &pa_opcodes[i];
-- 
2.39.2



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

* Re: [RFC PATCH] disas/hppa: drop raw opcode dump
  2024-02-29 14:05 [RFC PATCH] disas/hppa: drop raw opcode dump Alex Bennée
@ 2024-02-29 15:02 ` Helge Deller
  2024-02-29 16:41   ` Alex Bennée
  2024-02-29 18:11 ` Richard Henderson
  1 sibling, 1 reply; 4+ messages in thread
From: Helge Deller @ 2024-02-29 15:02 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel; +Cc: Richard Henderson

On 2/29/24 15:05, Alex Bennée wrote:
> The hppa disassembly is different from the others due to leading with
> the raw opcode data. This confuses plugins looking for instruction
> prefixes to match instructions. For plugins like execlog there is
> another mechanism for getting the instruction byte data.
>
> For the sake of consistently just present the instruction assembly
> code.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

This effectively reverts commit 2f926bfd5b79e6219ae65a1e530b38f37d62b384
("disas/hppa: Show hexcode of instruction along with disassembly").

Sad, but Ok.

Acked-by: Helge Deller <deller@gmx.de>


> ---
>   disas/hppa.c | 4 ----
>   1 file changed, 4 deletions(-)
>
> diff --git a/disas/hppa.c b/disas/hppa.c
> index 22dce9b41bb..dd34cce211b 100644
> --- a/disas/hppa.c
> +++ b/disas/hppa.c
> @@ -1972,10 +1972,6 @@ print_insn_hppa (bfd_vma memaddr, disassemble_info *info)
>
>     insn = bfd_getb32 (buffer);
>
> -  info->fprintf_func(info->stream, " %02x %02x %02x %02x   ",
> -                (insn >> 24) & 0xff, (insn >> 16) & 0xff,
> -                (insn >>  8) & 0xff, insn & 0xff);
> -
>     for (i = 0; i < NUMOPCODES; ++i)
>       {
>         const struct pa_opcode *opcode = &pa_opcodes[i];



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

* Re: [RFC PATCH] disas/hppa: drop raw opcode dump
  2024-02-29 15:02 ` Helge Deller
@ 2024-02-29 16:41   ` Alex Bennée
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Bennée @ 2024-02-29 16:41 UTC (permalink / raw)
  To: Helge Deller; +Cc: qemu-devel, Richard Henderson

Helge Deller <deller@gmx.de> writes:

> On 2/29/24 15:05, Alex Bennée wrote:
>> The hppa disassembly is different from the others due to leading with
>> the raw opcode data. This confuses plugins looking for instruction
>> prefixes to match instructions. For plugins like execlog there is
>> another mechanism for getting the instruction byte data.
>>
>> For the sake of consistently just present the instruction assembly
>> code.
>>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>
> This effectively reverts commit 2f926bfd5b79e6219ae65a1e530b38f37d62b384
> ("disas/hppa: Show hexcode of instruction along with disassembly").
>
> Sad, but Ok.
>
> Acked-by: Helge Deller <deller@gmx.de>

Well its an RFC for a reason. If this is useful we could just sneak a
flag into disassemble_info that is set by plugin_disas? Or maybe move
the insn stream to afterwards?

>
>
>> ---
>>   disas/hppa.c | 4 ----
>>   1 file changed, 4 deletions(-)
>>
>> diff --git a/disas/hppa.c b/disas/hppa.c
>> index 22dce9b41bb..dd34cce211b 100644
>> --- a/disas/hppa.c
>> +++ b/disas/hppa.c
>> @@ -1972,10 +1972,6 @@ print_insn_hppa (bfd_vma memaddr, disassemble_info *info)
>>
>>     insn = bfd_getb32 (buffer);
>>
>> -  info->fprintf_func(info->stream, " %02x %02x %02x %02x   ",
>> -                (insn >> 24) & 0xff, (insn >> 16) & 0xff,
>> -                (insn >>  8) & 0xff, insn & 0xff);
>> -
>>     for (i = 0; i < NUMOPCODES; ++i)
>>       {
>>         const struct pa_opcode *opcode = &pa_opcodes[i];

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


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

* Re: [RFC PATCH] disas/hppa: drop raw opcode dump
  2024-02-29 14:05 [RFC PATCH] disas/hppa: drop raw opcode dump Alex Bennée
  2024-02-29 15:02 ` Helge Deller
@ 2024-02-29 18:11 ` Richard Henderson
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2024-02-29 18:11 UTC (permalink / raw)
  To: Alex Bennée, qemu-devel

On 2/29/24 04:05, Alex Bennée wrote:
> The hppa disassembly is different from the others due to leading with
> the raw opcode data. This confuses plugins looking for instruction
> prefixes to match instructions. For plugins like execlog there is
> another mechanism for getting the instruction byte data.
> 
> For the sake of consistently just present the instruction assembly
> code.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   disas/hppa.c | 4 ----
>   1 file changed, 4 deletions(-)
> 
> diff --git a/disas/hppa.c b/disas/hppa.c
> index 22dce9b41bb..dd34cce211b 100644
> --- a/disas/hppa.c
> +++ b/disas/hppa.c
> @@ -1972,10 +1972,6 @@ print_insn_hppa (bfd_vma memaddr, disassemble_info *info)
>   
>     insn = bfd_getb32 (buffer);
>   
> -  info->fprintf_func(info->stream, " %02x %02x %02x %02x   ",
> -                (insn >> 24) & 0xff, (insn >> 16) & 0xff,
> -                (insn >>  8) & 0xff, insn & 0xff);
> -

It's hardly the only one doing this.  Our capstone dumper does this, and glancing at some 
others riscv.c does as well.

When you say "the others", I think you mean "everything using capstone", which has uses a 
different print function entirely for plugins just to avoid the dump.


r~


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

end of thread, other threads:[~2024-02-29 18:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-29 14:05 [RFC PATCH] disas/hppa: drop raw opcode dump Alex Bennée
2024-02-29 15:02 ` Helge Deller
2024-02-29 16:41   ` Alex Bennée
2024-02-29 18:11 ` Richard Henderson

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 NNTP newsgroup(s).