summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-04-28 20:55:26 +0000
committerGreg Clayton <gclayton@apple.com>2011-04-28 20:55:26 +0000
commit68ebae61d1e51c2741c14bc9f1995270c84f51a6 (patch)
tree3b8d40d496747c4526cba0082267cd09c590d698 /lldb/source/Core
parentd36bdb5208dc7a9d7eab8e210606d459976d7fb3 (diff)
downloadbcm5719-llvm-68ebae61d1e51c2741c14bc9f1995270c84f51a6.tar.gz
bcm5719-llvm-68ebae61d1e51c2741c14bc9f1995270c84f51a6.zip
Added the ability to specify dumping options (show types, show location,
depth control, pointer depth, and more) when dumping memory and viewing as a type. llvm-svn: 130436
Diffstat (limited to 'lldb/source/Core')
-rw-r--r--lldb/source/Core/DataExtractor.cpp26
-rw-r--r--lldb/source/Core/ValueObject.cpp7
2 files changed, 15 insertions, 18 deletions
diff --git a/lldb/source/Core/DataExtractor.cpp b/lldb/source/Core/DataExtractor.cpp
index 4119828fca5..10a2029527d 100644
--- a/lldb/source/Core/DataExtractor.cpp
+++ b/lldb/source/Core/DataExtractor.cpp
@@ -1446,24 +1446,20 @@ DataExtractor::Dump
{
assert (item_bit_size == 0 && item_bit_offset == 0);
s->PutCString("0x");
- int32_t start_idx, end_idx, delta;
- if (m_byte_order == eByteOrderBig)
- {
- start_idx = offset;
- end_idx = offset + item_byte_size;
- delta = 1;
- }
- else
- {
- start_idx = offset + item_byte_size - 1;
- end_idx = -1;
- delta = -1;
- }
const uint8_t *bytes = (const uint8_t* )GetData(&offset, item_byte_size);
if (bytes)
{
- for (int32_t idx = start_idx; idx != end_idx; idx += delta)
- s->Printf("%2.2x", bytes[idx]);
+ uint32_t idx;
+ if (m_byte_order == eByteOrderBig)
+ {
+ for (idx = 0; idx < item_byte_size; ++idx)
+ s->Printf("%2.2x", bytes[idx]);
+ }
+ else
+ {
+ for (idx = 0; idx < item_byte_size; ++idx)
+ s->Printf("%2.2x", bytes[item_byte_size - 1 - idx]);
+ }
}
}
break;
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index 2b1beed3872..1f443e81502 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -674,13 +674,14 @@ ValueObject::GetValueAsCString ()
if (clang_type)
{
StreamString sstr;
- if (m_format == eFormatDefault)
- m_format = ClangASTType::GetFormat(clang_type);
+ Format format = GetFormat();
+ if (format == eFormatDefault)
+ format = ClangASTType::GetFormat(clang_type);
if (ClangASTType::DumpTypeValue (GetClangAST(), // The clang AST
clang_type, // The clang type to display
&sstr,
- m_format, // Format to display this type with
+ format, // Format to display this type with
m_data, // Data to extract from
0, // Byte offset into "m_data"
GetByteSize(), // Byte size of item in "m_data"
OpenPOWER on IntegriCloud