diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2022-03-20 11:40:34 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2022-05-14 11:43:05 +0000 |
commit | 349cc55c9796c4596a5b9904cd3281af295f878f (patch) | |
tree | 410c5a785075730a35f1272ca6a7adf72222ad03 /contrib/llvm-project/lldb/source/Commands/CommandObjectFrame.cpp | |
parent | cb2ae6163174b90e999326ecec3699ee093a5d43 (diff) | |
parent | c0981da47d5696fe36474fcf86b4ce03ae3ff818 (diff) |
Diffstat (limited to 'contrib/llvm-project/lldb/source/Commands/CommandObjectFrame.cpp')
-rw-r--r-- | contrib/llvm-project/lldb/source/Commands/CommandObjectFrame.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/contrib/llvm-project/lldb/source/Commands/CommandObjectFrame.cpp b/contrib/llvm-project/lldb/source/Commands/CommandObjectFrame.cpp index d90e357bf1aa..2b9f5316409f 100644 --- a/contrib/llvm-project/lldb/source/Commands/CommandObjectFrame.cpp +++ b/contrib/llvm-project/lldb/source/Commands/CommandObjectFrame.cpp @@ -14,6 +14,7 @@ #include "lldb/Host/OptionParser.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" +#include "lldb/Interpreter/OptionArgParser.h" #include "lldb/Interpreter/OptionGroupFormat.h" #include "lldb/Interpreter/OptionGroupValueObjectDisplay.h" #include "lldb/Interpreter/OptionGroupVariable.h" @@ -104,7 +105,7 @@ public: CommandObjectFrameDiagnose(CommandInterpreter &interpreter) : CommandObjectParsed(interpreter, "frame diagnose", - "Try to determine what path path the current stop " + "Try to determine what path the current stop " "location used to get to a register or address", nullptr, eCommandRequiresThread | eCommandTryTargetAPILock | @@ -707,11 +708,11 @@ protected: // Increment statistics. bool res = result.Succeeded(); - Target &target = GetSelectedOrDummyTarget(); + TargetStats &target_stats = GetSelectedOrDummyTarget().GetStatistics(); if (res) - target.IncrementStats(StatisticKind::FrameVarSuccess); + target_stats.GetFrameVariableStats().NotifySuccess(); else - target.IncrementStats(StatisticKind::FrameVarFailure); + target_stats.GetFrameVariableStats().NotifyFailure(); return res; } @@ -739,6 +740,17 @@ private: const int short_option = m_getopt_table[option_idx].val; switch (short_option) { + case 'f': { + bool value, success; + value = OptionArgParser::ToBoolean(option_arg, true, &success); + if (success) { + m_first_instruction_only = value; + } else { + error.SetErrorStringWithFormat( + "invalid boolean value '%s' passed for -f option", + option_arg.str().c_str()); + } + } break; case 'l': m_class_name = std::string(option_arg); break; @@ -763,6 +775,7 @@ private: m_symbols.clear(); m_class_name = ""; m_regex = false; + m_first_instruction_only = true; } llvm::ArrayRef<OptionDefinition> GetDefinitions() override { @@ -774,6 +787,7 @@ private: std::string m_module; std::vector<std::string> m_symbols; bool m_regex; + bool m_first_instruction_only; }; CommandOptions m_options; @@ -883,13 +897,13 @@ bool CommandObjectFrameRecognizerAdd::DoExecute(Args &command, auto func = RegularExpressionSP(new RegularExpression(m_options.m_symbols.front())); GetSelectedOrDummyTarget().GetFrameRecognizerManager().AddRecognizer( - recognizer_sp, module, func); + recognizer_sp, module, func, m_options.m_first_instruction_only); } else { auto module = ConstString(m_options.m_module); std::vector<ConstString> symbols(m_options.m_symbols.begin(), m_options.m_symbols.end()); GetSelectedOrDummyTarget().GetFrameRecognizerManager().AddRecognizer( - recognizer_sp, module, symbols); + recognizer_sp, module, symbols, m_options.m_first_instruction_only); } #endif |