public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/1] gdb/riscv: Cache per-BFD disassembler
@ 2022-10-09  3:59 Tsukasa OI
  2022-10-09  3:59 ` [RFC PATCH 1/1] " Tsukasa OI
  0 siblings, 1 reply; 4+ messages in thread
From: Tsukasa OI @ 2022-10-09  3:59 UTC (permalink / raw)
  To: Tsukasa OI, Andrew Burgess, Palmer Dabbelt; +Cc: gdb-patches

Hello,

On RISC-V, calling the disassembler function (libopcodes) is not a small
cost.  This is because riscv_get_disassembler function sets the default
architecture from given BFD's .riscv.attributes section.  However, by
default, GDB calls this function for every instruction.

This commit replaces RISC-V's disassembler function and stop calling
riscv_get_disassembler function if current BFD has not changed.

It expects around 30-80% improvements on disassembling relatively large
chunk of RISC-V code but most of them will be obscured by a RISC-V
disassembler optimization the author is currently working on.  Still, 3-5%
of performance improvements will remain (due to reduced BFD section reads).

[REQUEST FOR COMMENTS]

I'm confident that most of BFD contents won't change so dynamically on GDB
and caching itself is not a bad idea.  Still, I'm not sure whether this
usage of "static" variables is okay.

I would like to hear your thoughts.

Thanks,
Tsukasa




Tsukasa OI (1):
  gdb/riscv: Cache per-BFD disassembler

 gdb/riscv-tdep.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)


base-commit: c10a862f17847bc9c50d680c87b87dc51ae4b95e
-- 
2.34.1


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

end of thread, other threads:[~2022-10-16 15:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-09  3:59 [RFC PATCH 0/1] gdb/riscv: Cache per-BFD disassembler 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 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).