From fd4e5a8801beb76f1836aad9b54cb1328faadd51 Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Mon, 2 May 2016 18:13:18 +0000 Subject: Add an argument to ValueObject::GetSyntheticBase that allows for name customization on the generated value llvm-svn: 268274 --- lldb/source/Core/ValueObject.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lldb/source/Core/ValueObject.cpp') diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index 69205aaf754..a74599e00df 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -2227,13 +2227,19 @@ ValueObject::GetSyntheticChildAtOffset(uint32_t offset, } ValueObjectSP -ValueObject::GetSyntheticBase (uint32_t offset, const CompilerType& type, bool can_create) +ValueObject::GetSyntheticBase (uint32_t offset, + const CompilerType& type, + bool can_create, + ConstString name_const_str) { ValueObjectSP synthetic_child_sp; - char name_str[64]; - snprintf(name_str, sizeof(name_str), "%s", type.GetTypeName().AsCString("")); - ConstString name_const_str(name_str); + if (name_const_str.IsEmpty()) + { + char name_str[128]; + snprintf(name_str, sizeof(name_str), "base%s@%i", type.GetTypeName().AsCString(""), offset); + name_const_str.SetCString(name_str); + } // Check if we have already created a synthetic array member in this // valid object. If we have we will re-use it. -- cgit v1.2.3