diff options
author | Andrew Burgess <aburgess@redhat.com> | 2022-06-23 11:49:08 +0100 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2022-10-02 11:57:30 +0100 |
commit | d309a8f9b34d8fd570dc8c7189eb6790b9afd4e3 (patch) | |
tree | 74bf9517a03cea105f7dd82f9ebfe87325dfab51 /gdb/disasm.h | |
parent | 21a52f7d827dab6bf14f81f478e1f9c7bdc7f218 (diff) | |
download | gdb-d309a8f9b34d8fd570dc8c7189eb6790b9afd4e3.zip gdb-d309a8f9b34d8fd570dc8c7189eb6790b9afd4e3.tar.gz gdb-d309a8f9b34d8fd570dc8c7189eb6790b9afd4e3.tar.bz2 |
gdb/disasm: read opcodes bytes with a single read_code call
This commit reduces the number of times we call read_code when
printing the instruction opcode bytes during disassembly.
I've added a new gdb::byte_vector within the
gdb_pretty_print_disassembler class, in line with all the other
buffers that gdb_pretty_print_disassembler needs. This byte_vector is
then resized as needed, and filled with a single read_code call for
each instruction.
There should be no user visible changes after this commit.
Diffstat (limited to 'gdb/disasm.h')
-rw-r--r-- | gdb/disasm.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/disasm.h b/gdb/disasm.h index 09cb392..dab6116 100644 --- a/gdb/disasm.h +++ b/gdb/disasm.h @@ -344,6 +344,9 @@ private: /* The buffer used to build the raw opcodes string. */ string_file m_opcode_stb; + + /* The buffer used to hold the opcode bytes (if required). */ + gdb::byte_vector m_opcode_data; }; /* Return the length in bytes of the instruction at address MEMADDR in |