summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-01-08 22:55:04 +0000
committerGreg Clayton <gclayton@apple.com>2011-01-08 22:55:04 +0000
commitc925f02863282aeabe5f172c0e2e609187963499 (patch)
treed710b401466aa22600552105fdca1ba56280128e /lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
parent0939bc3709c7ecc686be7dc2793fbcbffa993a26 (diff)
downloadbcm5719-llvm-c925f02863282aeabe5f172c0e2e609187963499.tar.gz
bcm5719-llvm-c925f02863282aeabe5f172c0e2e609187963499.zip
Fixed the "-b" option on disassembly to always pad out the bytes with for
i386 and for x86_64 to allow 15 byte opcodes to be displayed. This outputs clean looking disassembly when the bytes are shown. llvm-svn: 123094
Diffstat (limited to 'lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp')
-rw-r--r--lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
index 9ba97f03769..456c63f4bdd 100644
--- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
+++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
@@ -129,11 +129,14 @@ DisassemblerLLVM::InstructionLLVM::Dump
if (bytes)
{
uint32_t bytes_dumped = bytes->Dump(s, bytes_offset, eFormatBytes, 1, EDInstByteSize(m_inst), UINT32_MAX, LLDB_INVALID_ADDRESS, 0, 0) - bytes_offset;
- // Allow for 8 bytes of opcodes normally
- const uint32_t default_num_opcode_bytes = 9;
+ // Allow for 15 bytes of opcodes since this is the max for x86_64.
+ // TOOD: We need to taylor this better for different architectures. For
+ // ARM we would want to show 16 bit opcodes for Thumb as properly byte
+ // swapped uint16_t values, or 32 bit values swapped values for ARM.
+ const uint32_t default_num_opcode_bytes = 15;
if (bytes_dumped * 3 < (default_num_opcode_bytes*3))
{
- uint32_t indent_level = (default_num_opcode_bytes*3) - (bytes_dumped * 3);
+ uint32_t indent_level = (default_num_opcode_bytes*3) - (bytes_dumped * 3) + 1;
s->Printf("%*.*s", indent_level, indent_level, "");
}
}
OpenPOWER on IntegriCloud