Fix an issue where LLDB would crash if one tried to 'frame variable' an unordered_map more than once in a stop due to the synthetic provider not properly caching the ValueObjects it was returning for the child elements

Fixes rdar://26470909

llvm-svn: 270752
This commit is contained in:
Enrico Granata 2016-05-25 20:38:33 +00:00
parent d5d37dcf83
commit f02be230f6
2 changed files with 8 additions and 4 deletions

View File

@ -72,5 +72,6 @@ class LibcxxUnorderedDataFormatterTestCase(TestBase):
'(\[\d\] = "world"(\\n|.)+){2}'])
def look_for_content_and_continue(self, var_name, patterns):
self.expect( ("frame variable %s" % var_name), patterns=patterns)
self.expect( ("frame variable %s" % var_name), patterns=patterns)
self.runCmd("continue")

View File

@ -125,10 +125,13 @@ lldb_private::formatters::LibcxxStdUnorderedMapSyntheticFrontEnd::GetChildAtInde
return lldb::ValueObjectSP();
const bool thread_and_frame_only_if_stopped = true;
ExecutionContext exe_ctx = val_hash.first->GetExecutionContextRef().Lock(thread_and_frame_only_if_stopped);
return val_hash.first->CreateValueObjectFromData(stream.GetData(),
data,
exe_ctx,
val_hash.first->GetCompilerType());
ValueObjectSP child_sp(val_hash.first->CreateValueObjectFromData(stream.GetData(),
data,
exe_ctx,
val_hash.first->GetCompilerType()));
if (child_sp)
m_children.emplace(idx, child_sp);
return child_sp;
}
bool