A lean way for getting the size of the instruction at a given address

Zied Guermazi
2021-04-04T07:59:08Z

hi

I need to get the size of the instruction at a given address. I am
currently using gdb_insn_length (struct gdbarch *gdbarch, CORE_ADDR
addr) which calls gdb_print_insn (struct gdbarch *gdbarch, CORE_ADDR
memaddr, struct ui_file *stream, int *branch_delay_insns). and this is
consuming a huge time, considering that this is used in branch tracing
and this gets repeated up to few millions times.

Is there a lean way for getting the size of the instruction at a given
address, I am using it for aarch64 and arm targets.

Kind Regards

Zied Guermazi