summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/source/Core/ValueObject.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index 3e0a31833ef..609c518b2e3 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -1224,7 +1224,8 @@ ValueObject::ReadPointedString (lldb::DataBufferSP& buffer_sp,
size_t cstr_len = 0;
bool capped_data = false;
- if (type_flags.Test (eTypeIsArray))
+ const bool is_array = type_flags.Test (eTypeIsArray);
+ if (is_array)
{
// We have an array
uint64_t array_size = 0;
@@ -1247,10 +1248,20 @@ ValueObject::ReadPointedString (lldb::DataBufferSP& buffer_sp,
if (cstr_address == 0 || cstr_address == LLDB_INVALID_ADDRESS)
{
- s << "<invalid address>";
- error.SetErrorString("invalid address");
- CopyStringDataToBufferSP(s, buffer_sp);
- return {0,was_capped};
+ if (cstr_address_type == eAddressTypeHost && is_array)
+ {
+ const char* cstr = GetDataExtractor().PeekCStr(0);
+ buffer_sp.reset(new DataBufferHeap(cstr_len, 0));
+ memcpy(buffer_sp->GetBytes(), cstr, cstr_len);
+ return {cstr_len,was_capped};
+ }
+ else
+ {
+ s << "<invalid address>";
+ error.SetErrorString("invalid address");
+ CopyStringDataToBufferSP(s, buffer_sp);
+ return {0,was_capped};
+ }
}
Address cstr_so_addr (cstr_address);
OpenPOWER on IntegriCloud