summaryrefslogtreecommitdiffstats
path: root/lldb/source/DataFormatters
diff options
context:
space:
mode:
authorTamas Berghammer <tberghammer@google.com>2017-03-31 20:48:00 +0000
committerTamas Berghammer <tberghammer@google.com>2017-03-31 20:48:00 +0000
commit4fbb55b7b1b87cf22c05e73ce6e8207e25f02205 (patch)
tree75d45be28581fb247690ca0b520f05d374dc7a3e /lldb/source/DataFormatters
parentb326411fdcc8061a1dda2ca53e4535a60e2d5024 (diff)
downloadbcm5719-llvm-4fbb55b7b1b87cf22c05e73ce6e8207e25f02205.tar.gz
bcm5719-llvm-4fbb55b7b1b87cf22c05e73ce6e8207e25f02205.zip
Stop calling ValueObject::SetName from synthetic child providers
Summary: Calling ValueObject::SetName from a sythetic child provider would change the underying value object used for the non-synthetic child as well what is clearly unintentional. Reviewers: jingham, labath Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D31371 llvm-svn: 299259
Diffstat (limited to 'lldb/source/DataFormatters')
-rw-r--r--lldb/source/DataFormatters/VectorType.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/lldb/source/DataFormatters/VectorType.cpp b/lldb/source/DataFormatters/VectorType.cpp
index 652bde792ab..4fb92cad398 100644
--- a/lldb/source/DataFormatters/VectorType.cpp
+++ b/lldb/source/DataFormatters/VectorType.cpp
@@ -204,14 +204,12 @@ public:
if (idx >= CalculateNumChildren())
return lldb::ValueObjectSP();
auto offset = idx * m_child_type.GetByteSize(nullptr);
- ValueObjectSP child_sp(
- m_backend.GetSyntheticChildAtOffset(offset, m_child_type, true));
- if (!child_sp)
- return child_sp;
-
StreamString idx_name;
idx_name.Printf("[%" PRIu64 "]", (uint64_t)idx);
- child_sp->SetName(ConstString(idx_name.GetString()));
+ ValueObjectSP child_sp(m_backend.GetSyntheticChildAtOffset(
+ offset, m_child_type, true, ConstString(idx_name.GetString())));
+ if (!child_sp)
+ return child_sp;
child_sp->SetFormat(m_item_format);
OpenPOWER on IntegriCloud