aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectFrame.cpp
diff options
context:
space:
mode:
authorMed Ismail Bennani <medismail.bennani@gmail.com>2020-02-10 23:29:12 +0100
committerMed Ismail Bennani <medismail.bennani@gmail.com>2020-02-11 11:44:37 +0100
commitcb0c4ee3ebfe55809c9d0be72726b05668028fc4 (patch)
tree0b6137aa609a1bd595575a20c066a3cfb1343e38 /lldb/source/Commands/CommandObjectFrame.cpp
parentb4a3e6b66428c3eea9271f24b625f4f0f6b30905 (diff)
downloadllvm-cb0c4ee3ebfe55809c9d0be72726b05668028fc4.zip
llvm-cb0c4ee3ebfe55809c9d0be72726b05668028fc4.tar.gz
llvm-cb0c4ee3ebfe55809c9d0be72726b05668028fc4.tar.bz2
[lldb/test] Add alternate symbol to StackFrame Recognizer
This reimplements commit 6b2979c12300b90a1e69791d43ee9cff14f4265e and updates the tests to reflect the addition of the alternate symbol attribute. Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Diffstat (limited to 'lldb/source/Commands/CommandObjectFrame.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectFrame.cpp27
1 files changed, 20 insertions, 7 deletions
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp
index d86b50b..baf64e5 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -881,7 +881,7 @@ bool CommandObjectFrameRecognizerAdd::DoExecute(Args &command,
} else {
auto module = ConstString(m_options.m_module);
auto func = ConstString(m_options.m_function);
- StackFrameRecognizerManager::AddRecognizer(recognizer_sp, module, func);
+ StackFrameRecognizerManager::AddRecognizer(recognizer_sp, module, func, {});
}
#endif
@@ -959,13 +959,26 @@ protected:
bool any_printed = false;
StackFrameRecognizerManager::ForEach(
[&result, &any_printed](uint32_t recognizer_id, std::string name,
- std::string function, std::string symbol,
- bool regexp) {
- if (name == "")
+ std::string module, std::string symbol,
+ std::string alternate_symbol, bool regexp) {
+ Stream &stream = result.GetOutputStream();
+
+ if (name.empty())
name = "(internal)";
- result.GetOutputStream().Printf(
- "%d: %s, module %s, function %s%s\n", recognizer_id, name.c_str(),
- function.c_str(), symbol.c_str(), regexp ? " (regexp)" : "");
+
+ stream << std::to_string(recognizer_id) << ": " << name;
+ if (!module.empty())
+ stream << ", module " << module;
+ if (!symbol.empty())
+ stream << ", function " << symbol;
+ if (!alternate_symbol.empty())
+ stream << ", symbol " << alternate_symbol;
+ if (regexp)
+ stream << " (regexp)";
+
+ stream.EOL();
+ stream.Flush();
+
any_printed = true;
});