From: Alistair Francis <alistair23@gmail.com>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: qemu-devel@nongnu.org,
Alistair Francis <Alistair.Francis@wdc.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Richard Henderson <richard.henderson@linaro.org>,
qemu-riscv@nongnu.org, Song Gao <gaosong@loongson.cn>
Subject: Re: [PATCH 4/4] target/riscv: honour no_raw_bytes when disassembling
Date: Wed, 6 Mar 2024 10:14:31 +1000 [thread overview]
Message-ID: <CAKmqyKM17uFQKmV9vYQFVnwsg2athgs-2w5-O8y3ye+tsmupxA@mail.gmail.com> (raw)
In-Reply-To: <20240304191337.3101411-5-alex.bennee@linaro.org>
On Tue, Mar 5, 2024 at 5:15 AM Alex Bennée <alex.bennee@linaro.org> wrote:
>
> This makes the output suitable when used for plugins.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> disas/riscv.c | 28 +++++++++++++++-------------
> 1 file changed, 15 insertions(+), 13 deletions(-)
>
> diff --git a/disas/riscv.c b/disas/riscv.c
> index 8a546d5ea53..86028efea85 100644
> --- a/disas/riscv.c
> +++ b/disas/riscv.c
> @@ -5192,19 +5192,21 @@ print_insn_riscv(bfd_vma memaddr, struct disassemble_info *info, rv_isa isa)
> }
> }
>
> - switch (len) {
> - case 2:
> - (*info->fprintf_func)(info->stream, INST_FMT_2, inst);
> - break;
> - case 4:
> - (*info->fprintf_func)(info->stream, INST_FMT_4, inst);
> - break;
> - case 6:
> - (*info->fprintf_func)(info->stream, INST_FMT_6, inst);
> - break;
> - default:
> - (*info->fprintf_func)(info->stream, INST_FMT_8, inst);
> - break;
> + if (!info->no_raw_bytes) {
> + switch (len) {
> + case 2:
> + (*info->fprintf_func)(info->stream, INST_FMT_2, inst);
> + break;
> + case 4:
> + (*info->fprintf_func)(info->stream, INST_FMT_4, inst);
> + break;
> + case 6:
> + (*info->fprintf_func)(info->stream, INST_FMT_6, inst);
> + break;
> + default:
> + (*info->fprintf_func)(info->stream, INST_FMT_8, inst);
> + break;
> + }
> }
>
> disasm_inst(buf, sizeof(buf), isa, memaddr, inst,
> --
> 2.39.2
>
>
prev parent reply other threads:[~2024-03-06 0:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-04 19:13 [PATCH 0/4 for 9.0] Clean-up disassembler handling for plugins Alex Bennée
2024-03-04 19:13 ` [PATCH 1/4] disas: introduce no_raw_bytes Alex Bennée
2024-03-04 19:26 ` Helge Deller
2024-03-04 22:43 ` Richard Henderson
2024-03-04 19:13 ` [PATCH 2/4] disas/hppa: honour no_raw_bytes Alex Bennée
2024-03-04 19:13 ` [PATCH 3/4] target/loongarch: honour no_raw_bytes when disassembling Alex Bennée
2024-03-04 19:13 ` [PATCH 4/4] target/riscv: " Alex Bennée
2024-03-06 0:14 ` Alistair Francis [this message]
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=CAKmqyKM17uFQKmV9vYQFVnwsg2athgs-2w5-O8y3ye+tsmupxA@mail.gmail.com \
--to=alistair23@gmail.com \
--cc=Alistair.Francis@wdc.com \
--cc=alex.bennee@linaro.org \
--cc=gaosong@loongson.cn \
--cc=palmer@dabbelt.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=richard.henderson@linaro.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).