aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
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/Plugins/Language/CPlusPlus/LibCxxMap.cpp
parentb326411fdcc8061a1dda2ca53e4535a60e2d5024 (diff)
downloadllvm-4fbb55b7b1b87cf22c05e73ce6e8207e25f02205.zip
llvm-4fbb55b7b1b87cf22c05e73ce6e8207e25f02205.tar.gz
llvm-4fbb55b7b1b87cf22c05e73ce6e8207e25f02205.tar.bz2
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/Plugins/Language/CPlusPlus/LibCxxMap.cpp')
-rw-r--r--lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp b/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
index 9a94e12..50d4510 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
@@ -406,7 +406,7 @@ lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::GetChildAtIndex(
case 1: {
auto child0_sp = potential_child_sp->GetChildAtIndex(0, true);
if (child0_sp && child0_sp->GetName() == g___cc)
- potential_child_sp = child0_sp;
+ potential_child_sp = child0_sp->Clone(ConstString(name.GetString()));
break;
}
case 2: {
@@ -414,11 +414,10 @@ lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::GetChildAtIndex(
auto child1_sp = potential_child_sp->GetChildAtIndex(1, true);
if (child0_sp && child0_sp->GetName() == g___cc && child1_sp &&
child1_sp->GetName() == g___nc)
- potential_child_sp = child0_sp;
+ potential_child_sp = child0_sp->Clone(ConstString(name.GetString()));
break;
}
}
- potential_child_sp->SetName(ConstString(name.GetString()));
}
m_iterators[idx] = iterator;
return potential_child_sp;