summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectMemory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Commands/CommandObjectMemory.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectMemory.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp
index 9400200070a..30dfe2a0bd5 100644
--- a/lldb/source/Commands/CommandObjectMemory.cpp
+++ b/lldb/source/Commands/CommandObjectMemory.cpp
@@ -462,11 +462,20 @@ public:
return false;
}
- size_t item_byte_size = m_options.m_byte_size ? m_options.m_byte_size : 1;
StreamString buffer (Stream::eBinary,
process->GetAddressByteSize(),
process->GetByteOrder());
+ size_t item_byte_size = m_options.m_byte_size;
+
+ if (m_options.m_byte_size == 0)
+ {
+ if (m_options.m_format == eFormatPointer)
+ item_byte_size = buffer.GetAddressByteSize();
+ else
+ item_byte_size = 1;
+ }
+
lldb::addr_t addr = Args::StringToUInt64(command.GetArgumentAtIndex(0), LLDB_INVALID_ADDRESS, 0);
if (addr == LLDB_INVALID_ADDRESS)
@@ -513,6 +522,8 @@ public:
case eFormatDefault:
case eFormatBytes:
case eFormatHex:
+ case eFormatPointer:
+
// Decode hex bytes
uval64 = Args::StringToUInt64(value_str, UINT64_MAX, 16, &success);
if (!success)
OpenPOWER on IntegriCloud