Author: Alex Langford Date: 2020-02-03T10:50:38-08:00 New Revision: 3014efe071988724b67f2dc106d36002aa03fa7d
URL: https://github.com/llvm/llvm-project/commit/3014efe071988724b67f2dc106d36002aa03fa7d DIFF: https://github.com/llvm/llvm-project/commit/3014efe071988724b67f2dc106d36002aa03fa7d.diff LOG: [lldb] Remove unused parameter from ValueObject::GetExpressionPath I previously removed the code in ValueObject::GetExpressionPath that took advantage of the parameter `qualify_cxx_base_classes`. As a result, this is now unused and can be removed. Added: Modified: lldb/include/lldb/Core/ValueObject.h lldb/include/lldb/Core/ValueObjectRegister.h lldb/source/API/SBValue.cpp lldb/source/Commands/CommandObjectFrame.cpp lldb/source/Core/ValueObject.cpp lldb/source/Core/ValueObjectRegister.cpp lldb/source/DataFormatters/ValueObjectPrinter.cpp lldb/source/Target/Process.cpp lldb/source/Target/StackFrame.cpp Removed: ################################################################################ diff --git a/lldb/include/lldb/Core/ValueObject.h b/lldb/include/lldb/Core/ValueObject.h index aa0ff60b3f7c..46127d7e2930 100644 --- a/lldb/include/lldb/Core/ValueObject.h +++ b/lldb/include/lldb/Core/ValueObject.h @@ -397,7 +397,7 @@ class ValueObject : public UserID { bool IsIntegerType(bool &is_signed); virtual void GetExpressionPath( - Stream &s, bool qualify_cxx_base_classes, + Stream &s, GetExpressionPathFormat = eGetExpressionPathFormatDereferencePointers); lldb::ValueObjectSP GetValueForExpressionPath( diff --git a/lldb/include/lldb/Core/ValueObjectRegister.h b/lldb/include/lldb/Core/ValueObjectRegister.h index e584be6e6057..8f364380adb6 100644 --- a/lldb/include/lldb/Core/ValueObjectRegister.h +++ b/lldb/include/lldb/Core/ValueObjectRegister.h @@ -137,7 +137,7 @@ class ValueObjectRegister : public ValueObject { bool ResolveValue(Scalar &scalar) override; void - GetExpressionPath(Stream &s, bool qualify_cxx_base_classes, + GetExpressionPath(Stream &s, GetExpressionPathFormat epformat = eGetExpressionPathFormatDereferencePointers) override; diff --git a/lldb/source/API/SBValue.cpp b/lldb/source/API/SBValue.cpp index 23827aac8e1a..803c1521ba5d 100644 --- a/lldb/source/API/SBValue.cpp +++ b/lldb/source/API/SBValue.cpp @@ -1154,7 +1154,7 @@ bool SBValue::GetExpressionPath(SBStream &description) { ValueLocker locker; lldb::ValueObjectSP value_sp(GetSP(locker)); if (value_sp) { - value_sp->GetExpressionPath(description.ref(), false); + value_sp->GetExpressionPath(description.ref()); return true; } return false; @@ -1168,7 +1168,7 @@ bool SBValue::GetExpressionPath(SBStream &description, ValueLocker locker; lldb::ValueObjectSP value_sp(GetSP(locker)); if (value_sp) { - value_sp->GetExpressionPath(description.ref(), qualify_cxx_base_classes); + value_sp->GetExpressionPath(description.ref()); return true; } return false; diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp index 7e3c687f1690..d86b50bd7aad 100644 --- a/lldb/source/Commands/CommandObjectFrame.cpp +++ b/lldb/source/Commands/CommandObjectFrame.cpp @@ -172,8 +172,7 @@ class CommandObjectFrameDiagnose : public CommandObjectParsed { Stream &stream) -> bool { const ValueObject::GetExpressionPathFormat format = ValueObject:: GetExpressionPathFormat::eGetExpressionPathFormatHonorPointers; - const bool qualify_cxx_base_classes = false; - valobj_sp->GetExpressionPath(stream, qualify_cxx_base_classes, format); + valobj_sp->GetExpressionPath(stream, format); stream.PutCString(" ="); return true; }; diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index 99def5512088..486d175f645a 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -1446,7 +1446,7 @@ bool ValueObject::DumpPrintableRepresentation( break; case eValueObjectRepresentationStyleExpressionPath: - GetExpressionPath(strm, false); + GetExpressionPath(strm); str = strm.GetString(); break; } @@ -2037,7 +2037,7 @@ bool ValueObject::IsBaseClass(uint32_t &depth) { return true; } -void ValueObject::GetExpressionPath(Stream &s, bool qualify_cxx_base_classes, +void ValueObject::GetExpressionPath(Stream &s, GetExpressionPathFormat epformat) { // synthetic children do not actually "exist" as part of the hierarchy, and // sometimes they are consed up in ways that don't make sense from an @@ -2086,7 +2086,7 @@ void ValueObject::GetExpressionPath(Stream &s, bool qualify_cxx_base_classes, ValueObject *parent = GetParent(); if (parent) - parent->GetExpressionPath(s, qualify_cxx_base_classes, epformat); + parent->GetExpressionPath(s, epformat); // if we are a deref_of_parent just because we are synthetic array members // made up to allow ptr[%d] syntax to work in variable printing, then add our @@ -2846,7 +2846,7 @@ ValueObjectSP ValueObject::Dereference(Status &error) { return m_deref_valobj->GetSP(); } else { StreamString strm; - GetExpressionPath(strm, true); + GetExpressionPath(strm); if (is_pointer_or_reference_type) error.SetErrorStringWithFormat("dereference failed: (%s) %s", @@ -2872,7 +2872,7 @@ ValueObjectSP ValueObject::AddressOf(Status &error) { switch (address_type) { case eAddressTypeInvalid: { StreamString expr_path_strm; - GetExpressionPath(expr_path_strm, true); + GetExpressionPath(expr_path_strm); error.SetErrorStringWithFormat("'%s' is not in memory", expr_path_strm.GetData()); } break; @@ -2895,7 +2895,7 @@ ValueObjectSP ValueObject::AddressOf(Status &error) { } } else { StreamString expr_path_strm; - GetExpressionPath(expr_path_strm, true); + GetExpressionPath(expr_path_strm); error.SetErrorStringWithFormat("'%s' doesn't have a valid address", expr_path_strm.GetData()); } diff --git a/lldb/source/Core/ValueObjectRegister.cpp b/lldb/source/Core/ValueObjectRegister.cpp index 3df0b8c93e04..22a7b1513d3a 100644 --- a/lldb/source/Core/ValueObjectRegister.cpp +++ b/lldb/source/Core/ValueObjectRegister.cpp @@ -357,7 +357,6 @@ bool ValueObjectRegister::ResolveValue(Scalar &scalar) { } void ValueObjectRegister::GetExpressionPath(Stream &s, - bool qualify_cxx_base_classes, GetExpressionPathFormat epformat) { s.Printf("$%s", m_reg_info.name); } diff --git a/lldb/source/DataFormatters/ValueObjectPrinter.cpp b/lldb/source/DataFormatters/ValueObjectPrinter.cpp index 1c50566865a4..350d6cde5191 100644 --- a/lldb/source/DataFormatters/ValueObjectPrinter.cpp +++ b/lldb/source/DataFormatters/ValueObjectPrinter.cpp @@ -266,15 +266,13 @@ void ValueObjectPrinter::PrintDecl() { StreamString varName; - if (m_options.m_flat_output) { - // If we are showing types, also qualify the C++ base classes - const bool qualify_cxx_base_classes = show_type; - if (!m_options.m_hide_name) { - m_valobj->GetExpressionPath(varName, qualify_cxx_base_classes); + if (!m_options.m_hide_name) { + if (m_options.m_flat_output) + m_valobj->GetExpressionPath(varName); + else { + const char *name_cstr = GetRootNameForDisplay(""); + varName.Printf("%s", name_cstr); } - } else if (!m_options.m_hide_name) { - const char *name_cstr = GetRootNameForDisplay(""); - varName.Printf("%s", name_cstr); } bool decl_printed = false; diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index b2213d7fc962..3de6fe266d12 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -949,14 +949,11 @@ bool Process::HandleProcessStateChangedEvent(const EventSP &event_sp, ValueObjectSP valobj_sp = StopInfo::GetCrashingDereference( curr_thread_stop_info_sp, &crashing_address); if (valobj_sp) { - const bool qualify_cxx_base_classes = false; - const ValueObject::GetExpressionPathFormat format = ValueObject::GetExpressionPathFormat:: eGetExpressionPathFormatHonorPointers; stream->PutCString("Likely cause: "); - valobj_sp->GetExpressionPath(*stream, qualify_cxx_base_classes, - format); + valobj_sp->GetExpressionPath(*stream, format); stream->Printf(" accessed 0x%" PRIx64 "\n", crashing_address); } } diff --git a/lldb/source/Target/StackFrame.cpp b/lldb/source/Target/StackFrame.cpp index 55f7b05f9871..83c11470edef 100644 --- a/lldb/source/Target/StackFrame.cpp +++ b/lldb/source/Target/StackFrame.cpp @@ -673,7 +673,7 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath( if (actual_is_ptr != expr_is_ptr) { // Incorrect use of "." with a pointer, or "->" with a // class/union/struct instance or reference. - valobj_sp->GetExpressionPath(var_expr_path_strm, false); + valobj_sp->GetExpressionPath(var_expr_path_strm); if (actual_is_ptr) error.SetErrorStringWithFormat( "\"%s\" is a pointer and . was used to attempt to access " @@ -709,7 +709,7 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath( "this frame", name_const_string.GetCString()); } else { - valobj_sp->GetExpressionPath(var_expr_path_strm, false); + valobj_sp->GetExpressionPath(var_expr_path_strm); if (child_name) { error.SetErrorStringWithFormat( "\"%s\" is not a member of \"(%s) %s\"", @@ -782,7 +782,7 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath( Status error; ValueObjectSP temp(valobj_sp->Dereference(error)); if (error.Fail()) { - valobj_sp->GetExpressionPath(var_expr_path_strm, false); + valobj_sp->GetExpressionPath(var_expr_path_strm); error.SetErrorStringWithFormat( "could not dereference \"(%s) %s\"", valobj_sp->GetTypeName().AsCString("<invalid type>"), @@ -800,7 +800,7 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath( Status error; ValueObjectSP temp(valobj_sp->GetChildAtIndex(0, true)); if (error.Fail()) { - valobj_sp->GetExpressionPath(var_expr_path_strm, false); + valobj_sp->GetExpressionPath(var_expr_path_strm); error.SetErrorStringWithFormat( "could not get item 0 for \"(%s) %s\"", valobj_sp->GetTypeName().AsCString("<invalid type>"), @@ -837,7 +837,7 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath( || synthetic == valobj_sp) /* synthetic is the same as the original object */ { - valobj_sp->GetExpressionPath(var_expr_path_strm, false); + valobj_sp->GetExpressionPath(var_expr_path_strm); error.SetErrorStringWithFormat( "\"(%s) %s\" is not an array type", valobj_sp->GetTypeName().AsCString("<invalid type>"), @@ -846,7 +846,7 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath( static_cast<uint32_t>(child_index) >= synthetic ->GetNumChildren() /* synthetic does not have that many values */) { - valobj_sp->GetExpressionPath(var_expr_path_strm, false); + valobj_sp->GetExpressionPath(var_expr_path_strm); error.SetErrorStringWithFormat( "array index %ld is not valid for \"(%s) %s\"", child_index, valobj_sp->GetTypeName().AsCString("<invalid type>"), @@ -854,7 +854,7 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath( } else { child_valobj_sp = synthetic->GetChildAtIndex(child_index, true); if (!child_valobj_sp) { - valobj_sp->GetExpressionPath(var_expr_path_strm, false); + valobj_sp->GetExpressionPath(var_expr_path_strm); error.SetErrorStringWithFormat( "array index %ld is not valid for \"(%s) %s\"", child_index, valobj_sp->GetTypeName().AsCString("<invalid type>"), @@ -865,7 +865,7 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath( child_valobj_sp = valobj_sp->GetSyntheticArrayMember(child_index, true); if (!child_valobj_sp) { - valobj_sp->GetExpressionPath(var_expr_path_strm, false); + valobj_sp->GetExpressionPath(var_expr_path_strm); error.SetErrorStringWithFormat( "failed to use pointer as array for index %ld for " "\"(%s) %s\"", @@ -884,7 +884,7 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath( valobj_sp->GetSyntheticArrayMember(child_index, true); if (!child_valobj_sp) { - valobj_sp->GetExpressionPath(var_expr_path_strm, false); + valobj_sp->GetExpressionPath(var_expr_path_strm); error.SetErrorStringWithFormat( "array index %ld is not valid for \"(%s) %s\"", child_index, valobj_sp->GetTypeName().AsCString("<invalid type>"), @@ -895,7 +895,7 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath( child_valobj_sp = valobj_sp->GetSyntheticBitFieldChild( child_index, child_index, true); if (!child_valobj_sp) { - valobj_sp->GetExpressionPath(var_expr_path_strm, false); + valobj_sp->GetExpressionPath(var_expr_path_strm); error.SetErrorStringWithFormat( "bitfield range %ld-%ld is not valid for \"(%s) %s\"", child_index, child_index, @@ -909,7 +909,7 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath( || synthetic == valobj_sp) /* synthetic is the same as the original object */ { - valobj_sp->GetExpressionPath(var_expr_path_strm, false); + valobj_sp->GetExpressionPath(var_expr_path_strm); error.SetErrorStringWithFormat( "\"(%s) %s\" is not an array type", valobj_sp->GetTypeName().AsCString("<invalid type>"), @@ -918,7 +918,7 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath( static_cast<uint32_t>(child_index) >= synthetic ->GetNumChildren() /* synthetic does not have that many values */) { - valobj_sp->GetExpressionPath(var_expr_path_strm, false); + valobj_sp->GetExpressionPath(var_expr_path_strm); error.SetErrorStringWithFormat( "array index %ld is not valid for \"(%s) %s\"", child_index, valobj_sp->GetTypeName().AsCString("<invalid type>"), @@ -926,7 +926,7 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath( } else { child_valobj_sp = synthetic->GetChildAtIndex(child_index, true); if (!child_valobj_sp) { - valobj_sp->GetExpressionPath(var_expr_path_strm, false); + valobj_sp->GetExpressionPath(var_expr_path_strm); error.SetErrorStringWithFormat( "array index %ld is not valid for \"(%s) %s\"", child_index, valobj_sp->GetTypeName().AsCString("<invalid type>"), @@ -982,7 +982,7 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath( Status error; ValueObjectSP temp(valobj_sp->Dereference(error)); if (error.Fail()) { - valobj_sp->GetExpressionPath(var_expr_path_strm, false); + valobj_sp->GetExpressionPath(var_expr_path_strm); error.SetErrorStringWithFormat( "could not dereference \"(%s) %s\"", valobj_sp->GetTypeName().AsCString("<invalid type>"), @@ -999,7 +999,7 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath( Status error; ValueObjectSP temp(valobj_sp->GetChildAtIndex(0, true)); if (error.Fail()) { - valobj_sp->GetExpressionPath(var_expr_path_strm, false); + valobj_sp->GetExpressionPath(var_expr_path_strm); error.SetErrorStringWithFormat( "could not get item 0 for \"(%s) %s\"", valobj_sp->GetTypeName().AsCString("<invalid type>"), @@ -1013,7 +1013,7 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath( child_valobj_sp = valobj_sp->GetSyntheticBitFieldChild(child_index, final_index, true); if (!child_valobj_sp) { - valobj_sp->GetExpressionPath(var_expr_path_strm, false); + valobj_sp->GetExpressionPath(var_expr_path_strm); error.SetErrorStringWithFormat( "bitfield range %ld-%ld is not valid for \"(%s) %s\"", child_index, final_index, valobj_sp->GetTypeName().AsCString("<invalid type>"), @@ -1039,7 +1039,7 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath( default: // Failure... { - valobj_sp->GetExpressionPath(var_expr_path_strm, false); + valobj_sp->GetExpressionPath(var_expr_path_strm); error.SetErrorStringWithFormat( "unexpected char '%c' encountered after \"%s\" in \"%s\"", separator_type, var_expr_path_strm.GetData(), _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits