Skip to content

Commit 320301d

Browse files
fixup! fix tests
1 parent 4dda702 commit 320301d

19 files changed

+63
-62
lines changed

lldb/source/Plugins/Language/CPlusPlus/Coroutines.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,7 @@ StdlibCoroutineHandleSyntheticFrontEnd::GetIndexOfChildWithName(
207207
"'SyntheticChildrenFrontend::StdlibCoroutineHandleSyntheticFrontEnd' "
208208
"cannot find index of child '%s'. (m_resume_ptr_sp='%p', "
209209
"m_destroy_ptr_sp='%p')",
210-
name.AsCString(), static_cast<void *>(m_resume_ptr_sp.get()),
211-
static_cast<void *>(m_destroy_ptr_sp.get()));
210+
name.AsCString(), m_resume_ptr_sp.get(), m_destroy_ptr_sp.get());
212211

213212
if (name == ConstString("resume"))
214213
return 0;

lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,8 @@ ExtractLibcxxStringInfo(ValueObject &valobj) {
466466

467467
auto index_or_err = l->GetIndexOfChildWithName("__data_");
468468
if (!index_or_err) {
469-
LLDB_LOG_ERROR(GetLog(LLDBLog::Types), index_or_err.takeError(), "{0}");
469+
LLDB_LOG_ERROR(GetLog(LLDBLog::DataFormatters), index_or_err.takeError(),
470+
"{0}");
470471
return {};
471472
}
472473

lldb/source/Plugins/Language/CPlusPlus/LibCxxInitializerList.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ lldb_private::formatters::LibcxxInitializerListSyntheticFrontEnd::
106106
if (!m_start) {
107107
return llvm::createStringError(
108108
"'SyntheticChildrenFrontend::LibcxxInitializerListSyntheticFrontEnd' "
109-
"cannot find index of child '%s'",
109+
"cannot find index of child '%s': Invalid start pointer.",
110110
name.AsCString());
111111
}
112112
size_t idx = ExtractIndexFromString(name.GetCString());

lldb/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -501,9 +501,8 @@ lldb_private::formatters::LibCxxMapIteratorSyntheticFrontEnd::
501501
if (!m_pair_sp)
502502
return llvm::createStringError(
503503
"'SyntheticChildrenFrontend::LibCxxMapIteratorSyntheticFrontEnd' "
504-
"cannot find index of child '%s'. Underlying pair is invalid: "
505-
"m_pair_sp=%p",
506-
name.AsCString(), static_cast<void *>(m_pair_sp.get()));
504+
"cannot find index of child '%s': Invalid underlying pair.",
505+
name.AsCString());
507506

508507
return m_pair_sp->GetIndexOfChildWithName(name);
509508
}

lldb/source/Plugins/Language/CPlusPlus/LibCxxProxyArray.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ lldb_private::formatters::LibcxxStdProxyArraySyntheticFrontEnd::
179179
if (!m_base)
180180
return llvm::createStringError(
181181
"'SyntheticChildrenFrontend::LibcxxStdProxyArraySyntheticFrontEnd' "
182-
"cannot find index of child '%s'",
182+
"cannot find index of child '%s': Invalid base pointer.",
183183
name.AsCString());
184184
size_t idx = ExtractIndexFromString(name.GetCString());
185185
if (idx == UINT32_MAX) {

lldb/source/Plugins/Language/CPlusPlus/LibCxxQueue.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ class QueueFrontEnd : public SyntheticChildrenFrontEnd {
2323
llvm::Expected<size_t> GetIndexOfChildWithName(ConstString name) override {
2424
if (m_container_sp)
2525
return m_container_sp->GetIndexOfChildWithName(name);
26-
return llvm::createStringError("'SyntheticChildrenFrontend::QueueFrontEnd' "
27-
"cannot find index of child '%s'",
28-
name.AsCString());
26+
return llvm::createStringError(
27+
"'SyntheticChildrenFrontend::QueueFrontEnd' "
28+
"cannot find index of child '%s': Invalid underlying container.",
29+
name.AsCString());
2930
}
3031

3132
lldb::ChildCacheState Update() override;

lldb/source/Plugins/Language/CPlusPlus/LibCxxSliceArray.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ lldb_private::formatters::LibcxxStdSliceArraySyntheticFrontEnd::
150150
if (!m_start)
151151
return llvm::createStringError(
152152
"'SyntheticChildrenFrontend::LibcxxStdSliceArraySyntheticFrontEnd' "
153-
"cannot find index of child '%s'",
153+
"cannot find index of child '%s': Invalid start pointer.",
154154
name.AsCString());
155155
size_t idx = ExtractIndexFromString(name.GetCString());
156156
if (idx == UINT32_MAX) {

lldb/source/Plugins/Language/CPlusPlus/LibCxxSpan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ llvm::Expected<size_t> lldb_private::formatters::
132132
if (!m_start)
133133
return llvm::createStringError(
134134
"'SyntheticChildrenFrontEnd::LibcxxStdSpanSyntheticFrontEnd' cannot "
135-
"find index of child '%s'",
135+
"find index of child '%s': Invalid start pointer.",
136136
name.AsCString());
137137
size_t idx = ExtractIndexFromString(name.GetCString());
138138
if (idx == UINT32_MAX) {

lldb/source/Plugins/Language/CPlusPlus/LibCxxValarray.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ lldb_private::formatters::LibcxxStdValarraySyntheticFrontEnd::
129129
if (!m_start || !m_finish)
130130
return llvm::createStringError(
131131
"'SyntheticChildrenFrontEnd::LibcxxStdValarraySyntheticFrontEnd' "
132-
"cannot find index of child '%s'",
133-
name.AsCString());
132+
"cannot find index of child '%s'. (m_start='%d', m_finish='%d')",
133+
name.AsCString(), m_start, m_finish);
134134
size_t idx = ExtractIndexFromString(name.GetCString());
135135
if (idx == UINT32_MAX) {
136136
return llvm::createStringError(

lldb/source/Plugins/Language/CPlusPlus/LibCxxVector.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ lldb_private::formatters::LibcxxStdVectorSyntheticFrontEnd::
169169
if (!m_start || !m_finish)
170170
return llvm::createStringError(
171171
"'SyntheticChildrenFrontEnd::LibcxxStdVectorSyntheticFrontEnd' cannot "
172-
"find index of child '%s'",
173-
name.AsCString());
172+
"find index of child '%s'. (m_start='%d', m_finish='%d')",
173+
name.AsCString(), m_start, m_finish);
174174
size_t index = formatters::ExtractIndexFromString(name.GetCString());
175175
if (index == UINT32_MAX) {
176176
return llvm::createStringError(
@@ -277,8 +277,8 @@ lldb_private::formatters::LibcxxVectorBoolSyntheticFrontEnd::
277277
if (!m_count || !m_base_data_address)
278278
return llvm::createStringError(
279279
"'SyntheticChildrenFrontEnd::LibcxxVectorBoolSyntheticFrontEnd' cannot "
280-
"find index of child '%s'",
281-
name.AsCString());
280+
"find index of child '%s'. (m_count='%d', m_base_data_address='%d')",
281+
name.AsCString(), m_count, m_base_data_address);
282282
const char *item_name = name.GetCString();
283283
uint32_t idx = ExtractIndexFromString(item_name);
284284
if (idx == UINT32_MAX ||

lldb/source/Plugins/Language/ObjC/NSArray.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,8 @@ llvm::Expected<size_t> lldb_private::formatters::NSArrayMSyntheticFrontEndBase::
534534
(idx < UINT32_MAX && idx >= CalculateNumChildrenIgnoringErrors()))
535535
return llvm::createStringError(
536536
"'SyntheticChildrenFrontend::NSArrayMSyntheticFrontEndBase' cannot "
537-
"find index of child '%s'",
538-
name.AsCString());
537+
"find index of child '%s'. (idx='%d')",
538+
name.AsCString(), idx);
539539
return idx;
540540
}
541541

@@ -624,8 +624,8 @@ lldb_private::formatters::GenericNSArrayISyntheticFrontEnd<
624624
(idx < UINT32_MAX && idx >= CalculateNumChildrenIgnoringErrors()))
625625
return llvm::createStringError(
626626
"'SyntheticChildrenFrontEnd::ObjCClassSyntheticChildrenFrontEnd' "
627-
"cannot find index of child '%s'",
628-
name.AsCString());
627+
"cannot find index of child '%s'. (idx='%d')",
628+
name.AsCString(), idx);
629629
return idx;
630630
}
631631

lldb/source/Plugins/Language/ObjC/NSDictionary.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,8 @@ llvm::Expected<size_t> lldb_private::formatters::
593593
(idx < UINT32_MAX && idx >= CalculateNumChildrenIgnoringErrors()))
594594
return llvm::createStringError(
595595
"'SyntheticChildrenFrontEnd::NSDictionaryISyntheticFrontEnd' cannot "
596-
"find index of child '%s'",
597-
name.AsCString());
596+
"find index of child '%s'. (idx='%d')",
597+
name.AsCString(), idx);
598598
return idx;
599599
}
600600

@@ -730,8 +730,8 @@ llvm::Expected<size_t> lldb_private::formatters::
730730
(idx < UINT32_MAX && idx >= CalculateNumChildrenIgnoringErrors()))
731731
return llvm::createStringError(
732732
"'SyntheticChildrenFrontEnd::NSCFDictionarySyntheticFrontEnd' cannot "
733-
"find index of child '%s'",
734-
name.AsCString());
733+
"find index of child '%s'. (idx='%d')",
734+
name.AsCString(), idx);
735735
return idx;
736736
}
737737

@@ -866,8 +866,8 @@ lldb_private::formatters::NSConstantDictionarySyntheticFrontEnd::
866866
(idx < UINT32_MAX && idx >= CalculateNumChildrenIgnoringErrors()))
867867
return llvm::createStringError(
868868
"'SyntheticChildrenFrontEnd::NSConstantDictionarySyntheticFrontEnd' "
869-
"cannot find index of child '%s'",
870-
name.AsCString());
869+
"cannot find index of child '%s'. (idx='%d')",
870+
name.AsCString(), idx);
871871
return idx;
872872
}
873873

@@ -1072,8 +1072,8 @@ lldb_private::formatters::GenericNSDictionaryMSyntheticFrontEnd<
10721072
(idx < UINT32_MAX && idx >= CalculateNumChildrenIgnoringErrors()))
10731073
return llvm::createStringError(
10741074
"'SyntheticChildrenFrontEnd::GenericNSDictionaryMSyntheticFrontEnd' "
1075-
"cannot find index of child '%s'",
1076-
name.AsCString());
1075+
"cannot find index of child '%s'. (idx='%d')",
1076+
name.AsCString(), idx);
10771077
return idx;
10781078
}
10791079

@@ -1233,8 +1233,8 @@ llvm::Expected<size_t> lldb_private::formatters::Foundation1100::
12331233
(idx < UINT32_MAX && idx >= CalculateNumChildrenIgnoringErrors()))
12341234
return llvm::createStringError(
12351235
"'SyntheticChildrenFrontEnd::NSDictionaryMSyntheticFrontEnd' cannot "
1236-
"find index of child '%s'",
1237-
name.AsCString());
1236+
"find index of child '%s'. (idx='%d')",
1237+
name.AsCString(), idx);
12381238
return idx;
12391239
}
12401240

lldb/source/Plugins/Language/ObjC/NSIndexPath.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ class NSIndexPathSyntheticFrontEnd : public SyntheticChildrenFrontEnd {
133133
(idx < UINT32_MAX && idx >= CalculateNumChildrenIgnoringErrors()))
134134
return llvm::createStringError(
135135
"'SyntheticChildrenFrontEnd::NSIndexPathSyntheticFrontEnd' cannot "
136-
"find index of child '%s'",
137-
name.AsCString());
136+
"find index of child '%s'. (idx='%d')",
137+
name.AsCString(), idx);
138138
return idx;
139139
}
140140

lldb/source/Plugins/Language/ObjC/NSSet.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,8 @@ lldb_private::formatters::NSSetISyntheticFrontEnd::GetIndexOfChildWithName(
395395
(idx < UINT32_MAX && idx >= CalculateNumChildrenIgnoringErrors()))
396396
return llvm::createStringError(
397397
"'SyntheticChildrenFrontEnd::NSSetISyntheticFrontEnd' cannot find "
398-
"index of child '%s'",
399-
name.AsCString());
398+
"index of child '%s'. (idx='%d')",
399+
name.AsCString(), idx);
400400
return idx;
401401
}
402402

@@ -532,8 +532,8 @@ lldb_private::formatters::NSCFSetSyntheticFrontEnd::GetIndexOfChildWithName(
532532
(idx < UINT32_MAX && idx >= CalculateNumChildrenIgnoringErrors()))
533533
return llvm::createStringError(
534534
"'SyntheticChildrenFrontEnd::NSCFSetSyntheticFrontEnd' cannot find "
535-
"index of child '%s'",
536-
name.AsCString());
535+
"index of child '%s'. (idx='%d')",
536+
name.AsCString(), idx);
537537
return idx;
538538
}
539539

@@ -670,8 +670,8 @@ llvm::Expected<size_t> lldb_private::formatters::GenericNSSetMSyntheticFrontEnd<
670670
(idx < UINT32_MAX && idx >= CalculateNumChildrenIgnoringErrors()))
671671
return llvm::createStringError(
672672
"'SyntheticChildrenFrontEnd::GenericNSSetMSyntheticFrontEnd' cannot "
673-
"find index of child '%s'",
674-
name.AsCString());
673+
"find index of child '%s'. (idx='%d')",
674+
name.AsCString(), idx);
675675
return idx;
676676
}
677677

lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2042,21 +2042,21 @@ llvm::Expected<int> ScriptInterpreterPythonImpl::GetIndexOfChildWithName(
20422042
if (!implementor_sp)
20432043
return llvm::createStringError(
20442044
"'SyntheticChildrenFrontEnd::ScriptInterpreterPythonImpl' cannot find "
2045-
"index of child '%s'",
2046-
child_name);
2045+
"index of child '%s'. Invalid implementor (implementor_sp='%p').",
2046+
child_name, implementor_sp.get());
20472047

20482048
StructuredData::Generic *generic = implementor_sp->GetAsGeneric();
20492049
if (!generic)
20502050
return llvm::createStringError(
2051-
"'SyntheticChildrenFrontEnd::ScriptInterpreterPythonImpl' cannot find "
2052-
"index of child '%s'",
2053-
child_name);
2051+
"'ScriptInterpreterPythonImpl' cannot find index of child '%s'. Could "
2052+
"not get generic from implementor (generic='%p').",
2053+
child_name, generic);
20542054
auto *implementor = static_cast<PyObject *>(generic->GetValue());
20552055
if (!implementor)
20562056
return llvm::createStringError(
2057-
"'SyntheticChildrenFrontEnd::ScriptInterpreterPythonImpl' cannot find "
2058-
"index of child '%s'",
2059-
child_name);
2057+
"'ScriptInterpreterPythonImpl' cannot find index of child '%s'. Could "
2058+
"not cast to PyObject (implementor='%p')",
2059+
child_name, implementor);
20602060

20612061
int ret_val = INT32_MAX;
20622062

@@ -2069,8 +2069,7 @@ llvm::Expected<int> ScriptInterpreterPythonImpl::GetIndexOfChildWithName(
20692069

20702070
if (ret_val == INT32_MAX)
20712071
return llvm::createStringError(
2072-
"'SyntheticChildrenFrontEnd::ScriptInterpreterPythonImpl' cannot find "
2073-
"index of child '%s'",
2072+
"'ScriptInterpreterPythonImpl' cannot find index of child '%s'",
20742073
child_name);
20752074
return ret_val;
20762075
}

lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7159,9 +7159,8 @@ TypeSystemClang::GetIndexOfChildWithName(lldb::opaque_compiler_type_t type,
71597159
break;
71607160
}
71617161
}
7162-
return llvm::createStringError("'SyntheticChildrenFrontEnd::TypeSystemClang' "
7163-
"cannot find index of child '%s'",
7164-
name.str().c_str());
7162+
return llvm::createStringError(
7163+
"'TypeSystemClang' cannot find index of child '%s'", name.str().c_str());
71657164
}
71667165

71677166
CompilerType

lldb/source/Symbol/CompilerType.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,9 +1031,8 @@ CompilerType::GetIndexOfChildWithName(llvm::StringRef name,
10311031
return type_system_sp->GetIndexOfChildWithName(m_type, name,
10321032
omit_empty_base_classes);
10331033
}
1034-
return llvm::createStringError("'SyntheticChildrenFrontEnd::CompilerType' "
1035-
"cannot find index of child '%s'",
1036-
name.str().c_str());
1034+
return llvm::createStringError(
1035+
"'CompilerType' cannot find index of child '%s'", name.str().c_str());
10371036
}
10381037

10391038
// Dumping types

lldb/source/ValueObject/ValueObjectRegister.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ ValueObjectRegisterSet::GetIndexOfChildWithName(llvm::StringRef name) {
147147
return reg_info->kinds[eRegisterKindLLDB];
148148
}
149149
return llvm::createStringError(
150-
"'SyntheticChildrenFrontEnd::ValueObjectRegisterSet' cannot find index "
151-
"of child '%s'",
150+
"'ValueObjectRegisterSet' cannot find index of child '%s'",
152151
name.str().c_str());
153152
}
154153

lldb/source/ValueObject/ValueObjectSyntheticFilter.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,13 +350,18 @@ ValueObjectSynthetic::GetIndexOfChildWithName(llvm::StringRef name_ref) {
350350
std::lock_guard<std::mutex> guard(m_child_mutex);
351351
m_name_toindex[name.GetCString()] = *index_or_err;
352352
return *index_or_err;
353-
} else if (!found_index && m_synth_filter_up == nullptr)
353+
} else if (!found_index && m_synth_filter_up == nullptr) {
354354
return llvm::createStringError(
355355
"'SyntheticChildrenFrontEnd::ValueObjectSynthetic' cannot find index "
356-
"of child '%s'",
356+
"of child '%s'. m_synth_filter_up is null.",
357357
name.AsCString());
358-
else /*if (iter != m_name_toindex.end())*/
358+
} else if (found_index) {
359359
return *found_index;
360+
} else /*if (iter != m_name_toindex.end())*/
361+
return llvm::createStringError(
362+
"'SyntheticChildrenFrontEnd::ValueObjectSynthetic' cannot find index "
363+
"of child '%s'",
364+
name.AsCString());
360365
}
361366

362367
bool ValueObjectSynthetic::IsInScope() { return m_parent->IsInScope(); }

0 commit comments

Comments
 (0)