-
Notifications
You must be signed in to change notification settings - Fork 14.6k
[lldb] Upgrade GetIndexOfChildWithName
to use llvm::Expected
#136693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
f7d5ef8
db12ff1
4dda702
320301d
14b5250
86f52fa
a35fea8
8d13ebb
dcfe07b
443b930
8d14f51
8ce502e
ac7cf1f
3cf13ec
4699999
3db059d
23545b8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -593,8 +593,8 @@ llvm::Expected<size_t> lldb_private::formatters:: | |||||
(idx < UINT32_MAX && idx >= CalculateNumChildrenIgnoringErrors())) | ||||||
return llvm::createStringError( | ||||||
"'SyntheticChildrenFrontEnd::NSDictionaryISyntheticFrontEnd' cannot " | ||||||
"find index of child '%s'", | ||||||
name.AsCString()); | ||||||
"find index of child '%s'. (idx='%d')", | ||||||
name.AsCString(), idx); | ||||||
return idx; | ||||||
} | ||||||
|
||||||
|
@@ -730,8 +730,8 @@ llvm::Expected<size_t> lldb_private::formatters:: | |||||
(idx < UINT32_MAX && idx >= CalculateNumChildrenIgnoringErrors())) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Log idx here |
||||||
return llvm::createStringError( | ||||||
"'SyntheticChildrenFrontEnd::NSCFDictionarySyntheticFrontEnd' cannot " | ||||||
"find index of child '%s'", | ||||||
name.AsCString()); | ||||||
"find index of child '%s'. (idx='%d')", | ||||||
name.AsCString(), idx); | ||||||
return idx; | ||||||
} | ||||||
|
||||||
|
@@ -866,8 +866,8 @@ lldb_private::formatters::NSConstantDictionarySyntheticFrontEnd:: | |||||
(idx < UINT32_MAX && idx >= CalculateNumChildrenIgnoringErrors())) | ||||||
Michael137 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
return llvm::createStringError( | ||||||
"'SyntheticChildrenFrontEnd::NSConstantDictionarySyntheticFrontEnd' " | ||||||
"cannot find index of child '%s'", | ||||||
name.AsCString()); | ||||||
"cannot find index of child '%s'. (idx='%d')", | ||||||
name.AsCString(), idx); | ||||||
return idx; | ||||||
} | ||||||
|
||||||
|
@@ -1072,8 +1072,8 @@ lldb_private::formatters::GenericNSDictionaryMSyntheticFrontEnd< | |||||
(idx < UINT32_MAX && idx >= CalculateNumChildrenIgnoringErrors())) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Log idx here |
||||||
return llvm::createStringError( | ||||||
"'SyntheticChildrenFrontEnd::GenericNSDictionaryMSyntheticFrontEnd' " | ||||||
"cannot find index of child '%s'", | ||||||
name.AsCString()); | ||||||
"cannot find index of child '%s'. (idx='%d')", | ||||||
name.AsCString(), idx); | ||||||
return idx; | ||||||
} | ||||||
|
||||||
|
@@ -1233,8 +1233,8 @@ llvm::Expected<size_t> lldb_private::formatters::Foundation1100:: | |||||
(idx < UINT32_MAX && idx >= CalculateNumChildrenIgnoringErrors())) | ||||||
Michael137 marked this conversation as resolved.
Show resolved
Hide resolved
Michael137 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
return llvm::createStringError( | ||||||
"'SyntheticChildrenFrontEnd::NSDictionaryMSyntheticFrontEnd' cannot " | ||||||
"find index of child '%s'", | ||||||
name.AsCString()); | ||||||
"find index of child '%s'. (idx='%d')", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lets change all the index logging to:
Suggested change
|
||||||
name.AsCString(), idx); | ||||||
return idx; | ||||||
} | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -395,8 +395,8 @@ lldb_private::formatters::NSSetISyntheticFrontEnd::GetIndexOfChildWithName( | |
(idx < UINT32_MAX && idx >= CalculateNumChildrenIgnoringErrors())) | ||
return llvm::createStringError( | ||
"'SyntheticChildrenFrontEnd::NSSetISyntheticFrontEnd' cannot find " | ||
Michael137 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"index of child '%s'", | ||
name.AsCString()); | ||
"index of child '%s'. (idx='%d')", | ||
Michael137 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
name.AsCString(), idx); | ||
return idx; | ||
} | ||
|
||
|
@@ -532,8 +532,8 @@ lldb_private::formatters::NSCFSetSyntheticFrontEnd::GetIndexOfChildWithName( | |
(idx < UINT32_MAX && idx >= CalculateNumChildrenIgnoringErrors())) | ||
return llvm::createStringError( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lets log idx here |
||
"'SyntheticChildrenFrontEnd::NSCFSetSyntheticFrontEnd' cannot find " | ||
"index of child '%s'", | ||
name.AsCString()); | ||
"index of child '%s'. (idx='%d')", | ||
name.AsCString(), idx); | ||
return idx; | ||
} | ||
|
||
|
@@ -670,8 +670,8 @@ llvm::Expected<size_t> lldb_private::formatters::GenericNSSetMSyntheticFrontEnd< | |
(idx < UINT32_MAX && idx >= CalculateNumChildrenIgnoringErrors())) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lets log idx here |
||
return llvm::createStringError( | ||
"'SyntheticChildrenFrontEnd::GenericNSSetMSyntheticFrontEnd' cannot " | ||
"find index of child '%s'", | ||
name.AsCString()); | ||
"find index of child '%s'. (idx='%d')", | ||
name.AsCString(), idx); | ||
return idx; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -350,13 +350,18 @@ ValueObjectSynthetic::GetIndexOfChildWithName(llvm::StringRef name_ref) { | |||||||||||||||||||||||
std::lock_guard<std::mutex> guard(m_child_mutex); | ||||||||||||||||||||||||
m_name_toindex[name.GetCString()] = *index_or_err; | ||||||||||||||||||||||||
return *index_or_err; | ||||||||||||||||||||||||
} else if (!found_index && m_synth_filter_up == nullptr) | ||||||||||||||||||||||||
} else if (!found_index && m_synth_filter_up == nullptr) { | ||||||||||||||||||||||||
return llvm::createStringError( | ||||||||||||||||||||||||
"'SyntheticChildrenFrontEnd::ValueObjectSynthetic' cannot find index " | ||||||||||||||||||||||||
"of child '%s'", | ||||||||||||||||||||||||
"of child '%s'. m_synth_filter_up is null.", | ||||||||||||||||||||||||
name.AsCString()); | ||||||||||||||||||||||||
else /*if (iter != m_name_toindex.end())*/ | ||||||||||||||||||||||||
} else if (found_index) { | ||||||||||||||||||||||||
return *found_index; | ||||||||||||||||||||||||
} else /*if (iter != m_name_toindex.end())*/ | ||||||||||||||||||||||||
return llvm::createStringError( | ||||||||||||||||||||||||
"'SyntheticChildrenFrontEnd::ValueObjectSynthetic' cannot find index " | ||||||||||||||||||||||||
"of child '%s'", | ||||||||||||||||||||||||
name.AsCString()); | ||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||
} | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
bool ValueObjectSynthetic::IsInScope() { return m_parent->IsInScope(); } | ||||||||||||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.