-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
[lldb] Support frame recognizer regexp on mangled names. #105756
Changes from all commits
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 |
---|---|---|
|
@@ -63,25 +63,28 @@ void StackFrameRecognizerManager::BumpGeneration() { | |
void StackFrameRecognizerManager::AddRecognizer( | ||
StackFrameRecognizerSP recognizer, ConstString module, | ||
llvm::ArrayRef<ConstString> symbols, bool first_instruction_only) { | ||
m_recognizers.push_front({(uint32_t)m_recognizers.size(), recognizer, false, | ||
module, RegularExpressionSP(), symbols, | ||
RegularExpressionSP(), first_instruction_only}); | ||
m_recognizers.push_front( | ||
{(uint32_t)m_recognizers.size(), recognizer, false, module, | ||
RegularExpressionSP(), symbols, RegularExpressionSP(), | ||
Mangled::NamePreference::ePreferMangled, first_instruction_only}); | ||
BumpGeneration(); | ||
} | ||
|
||
void StackFrameRecognizerManager::AddRecognizer( | ||
StackFrameRecognizerSP recognizer, RegularExpressionSP module, | ||
RegularExpressionSP symbol, bool first_instruction_only) { | ||
RegularExpressionSP symbol, Mangled::NamePreference symbol_mangling, | ||
bool first_instruction_only) { | ||
m_recognizers.push_front({(uint32_t)m_recognizers.size(), recognizer, true, | ||
ConstString(), module, std::vector<ConstString>(), | ||
symbol, first_instruction_only}); | ||
symbol, symbol_mangling, first_instruction_only}); | ||
BumpGeneration(); | ||
} | ||
|
||
void StackFrameRecognizerManager::ForEach( | ||
const std::function<void(uint32_t, std::string, std::string, | ||
llvm::ArrayRef<ConstString>, bool)> &callback) { | ||
for (auto entry : m_recognizers) { | ||
llvm::ArrayRef<ConstString>, | ||
Mangled::NamePreference, bool)> &callback) { | ||
for (const auto &entry : m_recognizers) { | ||
if (entry.is_regexp) { | ||
std::string module_name; | ||
std::string symbol_name; | ||
|
@@ -92,11 +95,13 @@ void StackFrameRecognizerManager::ForEach( | |
symbol_name = entry.symbol_regexp->GetText().str(); | ||
|
||
callback(entry.recognizer_id, entry.recognizer->GetName(), module_name, | ||
llvm::ArrayRef(ConstString(symbol_name)), true); | ||
llvm::ArrayRef(ConstString(symbol_name)), entry.symbol_mangling, | ||
true); | ||
|
||
} else { | ||
callback(entry.recognizer_id, entry.recognizer->GetName(), | ||
entry.module.GetCString(), entry.symbols, false); | ||
entry.module.GetCString(), entry.symbols, entry.symbol_mangling, | ||
false); | ||
} | ||
} | ||
} | ||
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. afaict, the matching in In #105695, you can find an implementation of pretty much the same idea. However, I implemented only 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. 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. Ah looks like we had the same idea! 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. I'll let you commit your PR instead. 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. I relanded everything in 11d2de4. |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could be fancy and use an
llvm::interleaveComma
here