From: Tsukasa OI <research_trasio@irq.a4lg.com>
To: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [RFC PATCH 1/1] gdb/riscv: Cache per-BFD disassembler
Date: Mon, 17 Oct 2022 00:31:09 +0900 [thread overview]
Message-ID: <1a4f3042-a278-ba8f-ae8c-1cfe77ce64c9@irq.a4lg.com> (raw)
In-Reply-To: <871qrameqe.fsf@tromey.com>
On 2022/10/15 3:39, Tom Tromey wrote:
>>>>>> Tsukasa OI via Gdb-patches <gdb-patches@sourceware.org> writes:
>
>> +static int
>> +riscv_print_insn (bfd_vma memaddr, disassemble_info *info)
>> +{
>> + static disassembler_ftype disassemble_fn = NULL;
>> + static bfd *abfd = NULL;
>
> This seems mildly dangerous, in that a BFD could be destroyed, then a
> new one created with the same address.
>
> It's better to cache things using the registry system.
> See gdb/registry.h. You can look for "registry<bfd>" for examples.
>
> Tom
>
Thanks for letting me know.
Because my opcodes-side optimization on RISC-V will hide most of the
performance improvements made by that proposed patch, I will need to
redo the benchmark after I write a patch to use registry system. If
registry cost is too high, I will have to scrap this idea instead of
using the registry system.
Thanks,
Tsukasa
prev parent reply other threads:[~2022-10-16 15:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-09 3:59 [RFC PATCH 0/1] " Tsukasa OI
2022-10-09 3:59 ` [RFC PATCH 1/1] " Tsukasa OI
2022-10-14 18:39 ` Tom Tromey
2022-10-16 15:31 ` Tsukasa OI [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=1a4f3042-a278-ba8f-ae8c-1cfe77ce64c9@irq.a4lg.com \
--to=research_trasio@irq.a4lg.com \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).