<rdar://problem/16006373>

Revert the spirit of r199857 - a convincing case can be made that overriding a summary's format markers behind its back is not the right thing to do
This commit reverts the behavior of the code to the previous model, and changes the test case to validate the opposite of what it was validating before

llvm-svn: 201455
This commit is contained in:
Enrico Granata
2014-02-15 01:24:44 +00:00
parent 144d9a059b
commit 465f4bc287
3 changed files with 20 additions and 28 deletions

View File

@@ -282,15 +282,17 @@ ValueObjectPrinter::GetValueSummaryError (std::string& value,
std::string& summary,
std::string& error)
{
lldb::Format original_format;
bool custom_format = options.m_format != eFormatDefault && options.m_format != m_valobj->GetFormat();
if (custom_format)
if (options.m_format != eFormatDefault && options.m_format != m_valobj->GetFormat())
{
original_format = m_valobj->GetFormat();
m_valobj->SetFormat(options.m_format);
m_valobj->GetValueAsCString(options.m_format,
value);
}
else
{
const char* val_cstr = m_valobj->GetValueAsCString();
if (val_cstr)
value.assign(val_cstr);
}
const char* val_cstr = m_valobj->GetValueAsCString();
value.assign(val_cstr ? val_cstr : "");
const char* err_cstr = m_valobj->GetError().AsCString();
if (err_cstr)
error.assign(err_cstr);
@@ -312,8 +314,6 @@ ValueObjectPrinter::GetValueSummaryError (std::string& value,
}
}
}
if (custom_format)
m_valobj->SetFormat(original_format);
}
bool