diff options
Diffstat (limited to 'contrib/llvm-project/lldb/source/Core/Opcode.cpp')
| -rw-r--r-- | contrib/llvm-project/lldb/source/Core/Opcode.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/contrib/llvm-project/lldb/source/Core/Opcode.cpp b/contrib/llvm-project/lldb/source/Core/Opcode.cpp index 3e30d98975d8..6c9ced9c1123 100644 --- a/contrib/llvm-project/lldb/source/Core/Opcode.cpp +++ b/contrib/llvm-project/lldb/source/Core/Opcode.cpp @@ -21,7 +21,7 @@ using namespace lldb; using namespace lldb_private; -int Opcode::Dump(Stream *s, uint32_t min_byte_width) { +int Opcode::Dump(Stream *s, uint32_t min_byte_width) const { const uint32_t previous_bytes = s->GetWrittenBytes(); switch (m_type) { case Opcode::eTypeInvalid: @@ -38,6 +38,27 @@ int Opcode::Dump(Stream *s, uint32_t min_byte_width) { s->Printf("0x%8.8x", m_data.inst32); break; + case Opcode::eType16_32Tuples: { + const bool format_as_words = (m_data.inst.length % 4) == 0; + uint32_t i = 0; + while (i < m_data.inst.length) { + if (i > 0) + s->PutChar(' '); + if (format_as_words) { + // Format as words; print 1 or more UInt32 values. + s->Printf("%2.2x%2.2x%2.2x%2.2x", m_data.inst.bytes[i + 3], + m_data.inst.bytes[i + 2], m_data.inst.bytes[i + 1], + m_data.inst.bytes[i + 0]); + i += 4; + } else { + // Format as halfwords; print 1 or more UInt16 values. + s->Printf("%2.2x%2.2x", m_data.inst.bytes[i + 1], + m_data.inst.bytes[i + 0]); + i += 2; + } + } + } break; + case Opcode::eType64: s->Printf("0x%16.16" PRIx64, m_data.inst64); break; @@ -69,6 +90,7 @@ lldb::ByteOrder Opcode::GetDataByteOrder() const { case Opcode::eType8: case Opcode::eType16: case Opcode::eType16_2: + case Opcode::eType16_32Tuples: case Opcode::eType32: case Opcode::eType64: return endian::InlHostByteOrder(); @@ -113,6 +135,9 @@ uint32_t Opcode::GetData(DataExtractor &data) const { swap_buf[3] = m_data.inst.bytes[2]; buf = swap_buf; break; + case Opcode::eType16_32Tuples: + buf = GetOpcodeDataBytes(); + break; case Opcode::eType32: *(uint32_t *)swap_buf = llvm::byteswap<uint32_t>(m_data.inst32); buf = swap_buf; |
