12#include "lldb/Host/Config.h"
35#include "llvm/ADT/StringExtras.h"
36#include "llvm/ADT/StringRef.h"
45#pragma mark CommandObjectFrameDiagnose
51#define LLDB_OPTIONS_frame_diag
52#include "CommandOptions.inc"
66 switch (short_option) {
73 if (option_arg.getAsInteger(0, *
address)) {
76 "invalid address argument '%s'", option_arg.str().c_str());
82 if (option_arg.getAsInteger(0, *
offset)) {
85 "invalid offset argument '%s'", option_arg.str().c_str());
90 llvm_unreachable(
"Unimplemented option");
103 return llvm::ArrayRef(g_frame_diag_options);
108 std::optional<ConstString>
reg;
114 "Try to determine what path the current stop "
115 "location used to get to a register or address",
117 eCommandRequiresThread | eCommandTryTargetAPILock |
118 eCommandProcessMustBeLaunched |
119 eCommandProcessMustBePaused) {
137 "`frame diagnose --address` is incompatible with other arguments.");
140 valobj_sp = frame_sp->GuessValueForAddress(*
m_options.address);
142 valobj_sp = frame_sp->GuessValueForRegisterAndOffset(
145 StopInfoSP stop_info_sp = thread->GetStopInfo();
147 result.
AppendError(
"no arguments provided, and no stop info");
165 GetExpressionPathFormat::eGetExpressionPathFormatHonorPointers;
166 valobj_sp->GetExpressionPath(stream, format);
167 stream.PutCString(
" =");
175 assert(valobj_sp.get() &&
"Must have a valid ValueObject to print");
186#pragma mark CommandObjectFrameInfo
194 "List information about the current "
195 "stack frame in the current thread.",
197 eCommandRequiresFrame | eCommandTryTargetAPILock |
198 eCommandProcessMustBeLaunched |
199 eCommandProcessMustBePaused) {}
210#pragma mark CommandObjectFrameSelect
214#define LLDB_OPTIONS_frame_select
215#include "CommandOptions.inc"
229 switch (short_option) {
232 if (option_arg.getAsInteger(0, offset) || offset == INT32_MIN) {
234 "invalid frame offset argument '%s'", option_arg.str().c_str());
241 llvm_unreachable(
"Unimplemented option");
252 return llvm::ArrayRef(g_frame_select_options);
260 "Select the current stack frame by "
261 "index from within the current thread "
262 "(see 'thread backtrace'.)",
264 eCommandRequiresThread | eCommandTryTargetAPILock |
265 eCommandProcessMustBeLaunched |
266 eCommandProcessMustBePaused) {
276 uint32_t candidate_idx = frame_idx;
277 const unsigned max_depth = 12;
278 for (
unsigned num_try = 0; num_try < max_depth; ++num_try) {
279 if (candidate_idx == 0 && *
m_options.relative_frame_offset == -1) {
283 candidate_idx += *
m_options.relative_frame_offset;
284 if (
auto candidate_sp = thread.GetStackFrameAtIndex(candidate_idx)) {
285 if (candidate_sp->IsHidden())
294 m_options.relative_frame_offset = candidate_idx - frame_idx;
312 if ((*
m_options.relative_frame_offset == 1 ||
313 *
m_options.relative_frame_offset == -1)) {
314 if (
auto current_frame_sp = thread->GetStackFrameAtIndex(frame_idx);
315 !current_frame_sp->IsHidden())
319 if (*
m_options.relative_frame_offset < 0) {
320 if (
static_cast<int32_t
>(frame_idx) >=
322 frame_idx += *
m_options.relative_frame_offset;
324 if (frame_idx == 0) {
327 result.
AppendError(
"already at the bottom of the stack");
332 }
else if (*
m_options.relative_frame_offset > 0) {
337 const uint32_t frame_requested =
338 frame_idx + *
m_options.relative_frame_offset;
339 StackFrameSP frame_sp = thread->GetStackFrameAtIndex(frame_requested);
341 frame_idx = frame_requested;
344 const uint32_t num_frames = thread->GetStackFrameCount();
345 if (
static_cast<int32_t
>(num_frames - frame_idx) >
347 frame_idx += *
m_options.relative_frame_offset;
349 if (frame_idx == num_frames - 1) {
352 result.
AppendError(
"already at the top of the stack");
355 frame_idx = num_frames - 1;
362 "too many arguments; expected frame-index, saw '%s'",
372 if (command[0].ref().getAsInteger(0, frame_idx)) {
385 bool success = thread->SetSelectedFrameByIndexNoisily(
398#pragma mark CommandObjectFrameVariable
404 interpreter,
"frame variable",
405 "Show variables for the current stack frame. Defaults to all "
406 "arguments and local variables in scope. Names of argument, "
407 "local, file static and file global variables can be specified.",
409 eCommandRequiresFrame | eCommandTryTargetAPILock |
410 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused |
411 eCommandRequiresProcess),
416Children of aggregate variables can be specified such as 'var->child.x'. In
417'frame variable', the operators -> and [] do not invoke operator overloads if
418they exist, but directly access the specified element. If you want to trigger
419operator overloads use the expression command to print the variable instead.
421It is worth noting that except for overloaded operators, when printing local
422variables 'expr local_var' and 'frame var local_var' produce the same results.
423However, 'frame variable' is more efficient, since it uses debug information and
424memory reads directly, rather than parsing and evaluating an expression, which
425may even involve JITing and running code in the target program.)");
445 uint32_t index)
override {
446 llvm::StringRef depth_opt =
"--depth";
449 auto increment_option =
450 [&](llvm::StringRef option) -> std::optional<std::string> {
452 bool failed = option.getAsInteger(10, num);
455 return llvm::utostr(num + 1);
458 bool has_depth_option =
false;
459 bool increment_next_arg =
false;
460 for (
const auto &entry : current_command_args) {
461 llvm::StringRef arg = entry.ref();
463 if (arg ==
"-" || arg ==
"--") {
468 if (increment_next_arg) {
469 increment_next_arg =
false;
470 if (
auto maybe_opt = increment_option(arg)) {
476 if (depth_opt.starts_with(arg) || arg ==
"-D") {
478 increment_next_arg =
true;
479 has_depth_option =
true;
482 if (arg.consume_front(
"-D")) {
483 if (
auto maybe_opt = increment_option(arg)) {
484 repeat_args.
AppendArgument(llvm::formatv(
"-D{0}", *maybe_opt).str());
485 has_depth_option =
true;
493 if (!has_depth_option) {
498 auto [default_depth, _] =
499 target_sp->GetMaximumDepthOfChildrenToDisplay();
501 assert(repeat_args[0].ref() ==
"frame" &&
"expects resolved command");
507 std::string repeat_command;
510 return repeat_command;
516 return llvm::StringRef();
518 auto vt = var_sp->GetScope();
526 return is_synthetic ?
"(synthetic) GLOBAL: " :
"GLOBAL: ";
528 return is_synthetic ?
"(synthetic) STATIC: " :
"STATIC: ";
530 return is_synthetic ?
"(synthetic) ARG: " :
"ARG: ";
532 return is_synthetic ?
"(synthetic) LOCAL: " :
"LOCAL: ";
534 return is_synthetic ?
"(synthetic) THREAD: " :
"THREAD: ";
539 return llvm::StringRef();
572 llvm_unreachable(
"This flag was unset");
574 llvm_unreachable(
"Unexpected scope value");
583 std::optional<llvm::ArrayRef<VariableSP>>
587 bool any_matches =
false;
588 const size_t previous_num_vars = matches.
GetSize();
598 return matches.
toArrayRef().drop_front(previous_num_vars);
602 void DoExecute(Args &command, CommandReturnObject &result)
override {
605 StackFrame *frame =
m_exe_ctx.GetFramePtr();
618 VariableList *variable_list =
622 if (
error.Fail() && (!variable_list || variable_list->
GetSize() == 0)) {
634 summary_format_sp = std::make_shared<StringSummaryFormat>(
635 TypeSummaryImpl::Flags(),
642 const SymbolContext &sym_ctx =
650 recognized_arg_list = recognized_frame->GetRecognizedArguments();
653 options.SetFormat(format);
655 auto print_value = [&result, options](
ValueObjectSP valobj_sp) {
662 if (!command.
empty()) {
663 VariableList regex_var_list;
667 for (
auto &entry : command) {
669 llvm::StringRef name_str = entry.ref();
672 std::optional<llvm::ArrayRef<VariableSP>> results =
676 bool found_recognized =
false;
677 if (recognized_arg_list)
678 for (
auto &rec_value_sp : recognized_arg_list->GetObjects())
679 if (regex.
Execute(rec_value_sp->GetName())) {
680 found_recognized =
true;
681 print_value(rec_value_sp);
683 if (!found_recognized) {
685 "no variables matched the regular expression '%s'",
696 std::string scope_string;
700 if (!scope_string.empty())
704 var_sp->GetDeclaration().GetFile()) {
705 bool show_fullpaths =
false;
706 bool show_module =
true;
707 if (var_sp->DumpDeclaration(&s, show_fullpaths,
712 if (llvm::Error
error = valobj_sp->Dump(strm, options))
717 if (llvm::Error err = regex.
GetError())
718 result.
AppendError(llvm::toString(std::move(err)));
721 "unknown regex error when compiling '%s'", entry.c_str());
727 uint32_t expr_path_options =
740 if (valobj_sp &&
error.Success()) {
743 std::string scope_string;
747 if (!scope_string.empty())
750 var_sp->GetDeclaration().GetFile()) {
751 var_sp->GetDeclaration().DumpStopContext(&s,
false);
755 options.SetFormat(format);
756 options.SetVariableFormatDisplayLanguage(
757 valobj_sp->GetPreferredDisplayLanguage());
760 options.SetRootValueObjectName(
761 valobj_sp->GetParent() ? entry.c_str() :
nullptr);
766 if (llvm::Error
error = valobj_sp->Dump(output_stream, options))
770 bool found_recognized =
false;
771 if (recognized_arg_list)
772 for (
auto &obj_sp : recognized_arg_list->GetObjects())
773 if (obj_sp->GetName() == entry.ref()) {
774 found_recognized =
true;
778 if (!found_recognized) {
783 "unable to find any variable expression path that "
792 const size_t num_variables = variable_list->
GetSize();
793 if (num_variables > 0) {
794 for (
size_t i = 0; i < num_variables; i++) {
798 std::string scope_string;
811 if (valobj_sp->IsInScope()) {
812 if (!valobj_sp->GetTargetSP()
813 ->GetDisplayRuntimeSupportValues() &&
814 valobj_sp->IsRuntimeSupportValue())
817 if (!scope_string.empty())
821 var_sp->GetDeclaration().GetFile()) {
822 var_sp->GetDeclaration().DumpStopContext(&s,
false);
826 options.SetFormat(format);
827 options.SetVariableFormatDisplayLanguage(
828 valobj_sp->GetPreferredDisplayLanguage());
829 options.SetRootValueObjectName(
830 var_sp ? var_sp->GetName().AsCString(
nullptr) :
nullptr);
831 if (llvm::Error
error =
843 if (recognized_arg_list && (command.empty() || !variable_list))
844 for (
auto &rec_value_sp : recognized_arg_list->GetObjects())
845 print_value(rec_value_sp);
864#pragma mark CommandObjectFrameRecognizer
866#define LLDB_OPTIONS_frame_recognizer_add
867#include "CommandOptions.inc"
881 switch (short_option) {
889 "invalid boolean value '%s' passed for -f option",
890 option_arg.str().c_str());
900 m_symbols.push_back(std::string(option_arg));
906 llvm_unreachable(
"Unimplemented option");
921 return llvm::ArrayRef(g_frame_recognizer_add_options);
942 "Add a new frame recognizer.", nullptr,
943 eCommandAllowsDummyTarget) {
945Frame recognizers allow for retrieving information about special frames based on
946ABI, arguments or other special properties of that frame, even without source
947code or debug info. Currently, one use case is to extract function arguments
948that would otherwise be unaccesible, or augment existing arguments.
950Adding a custom frame recognizer is possible by implementing a Python class
951and using the 'frame recognizer add' command. The Python class should have a
952'get_recognized_arguments' method and it will receive an argument of type
953lldb.SBFrame representing the current frame that we are trying to recognize.
954The method should return a (possibly empty) list of lldb.SBValue objects that
955represent the recognized arguments.
957An example of a recognizer that retrieves the file descriptor values from libc
958functions 'read', 'write' and 'close' follows:
960 class LibcFdRecognizer(object):
961 def get_recognized_arguments(self, frame):
962 if frame.name in ["read", "write", "close"]:
963 fd = frame.EvaluateExpression("$arg1").unsigned
964 target = frame.thread.process.target
965 value = target.CreateValueFromExpression("fd", "(int)%d" % fd)
969The file containing this implementation can be imported via 'command script
970import' and then we can register this recognizer with 'frame recognizer add'.
971It's important to restrict the recognizer to the libc library (which is
972libsystem_kernel.dylib on macOS) to avoid matching functions with the same name
975(lldb) command script import .../fd_recognizer.py
976(lldb) frame recognizer add -l fd_recognizer.LibcFdRecognizer -n read -s libsystem_kernel.dylib
978When the program is stopped at the beginning of the 'read' function in libc, we
979can view the recognizer arguments in 'frame variable':
984* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.3
985 frame #0: 0x00007fff06013ca0 libsystem_kernel.dylib`read
996#if LLDB_ENABLE_PYTHON
1011 "%s needs at least one symbol name (-n argument)",
m_cmd_name.c_str());
1017 "%s needs only one symbol regular expression (-n argument)",
1026 result.
AppendWarning(
"the provided class does not exist - please define it "
1027 "before attempting to use this frame recognizer");
1032 interpreter,
m_options.m_class_name.c_str()));
1034 auto module = std::make_shared<RegularExpression>(m_options.m_module);
1036 std::make_shared<RegularExpression>(
m_options.m_symbols.front());
1041 auto module = ConstString(m_options.m_module);
1042 std::vector<ConstString> symbols(
m_options.m_symbols.begin(),
1045 recognizer_sp, module, symbols,
1058 "Delete all frame recognizers.", nullptr,
1059 eCommandAllowsDummyTarget) {}
1072 const std::string &module,
1073 llvm::ArrayRef<lldb_private::ConstString> symbols,
1076 strm <<
"[disabled] ";
1078 strm << name <<
", ";
1080 if (!module.empty())
1081 strm <<
"module " << module <<
", ";
1083 switch (symbol_mangling) {
1084 case Mangled::NamePreference ::ePreferMangled:
1085 strm <<
"mangled symbol ";
1087 case Mangled::NamePreference ::ePreferDemangled:
1088 strm <<
"demangled symbol ";
1090 case Mangled::NamePreference ::ePreferDemangledWithoutArguments:
1091 strm <<
"demangled (no args) symbol ";
1098 llvm::interleaveComma(symbols, strm);
1106 const char *help =
nullptr,
1107 const char *syntax =
nullptr,
1120 [&request](uint32_t rid,
bool enabled, std::string rname,
1122 llvm::ArrayRef<lldb_private::ConstString> symbols,
1126 rname =
"(internal)";
1129 symbol_mangling, regexp);
1136 uint32_t recognizer_id) = 0;
1139 uint32_t recognizer_id;
1155 interpreter,
"frame recognizer enable",
1156 "Enable a frame recognizer by id.", nullptr,
1157 eCommandAllowsDummyTarget) {
1165 uint32_t recognizer_id)
override {
1167 if (!recognizer_mgr.SetEnabledForID(recognizer_id,
true)) {
1181 interpreter,
"frame recognizer disable",
1182 "Disable a frame recognizer by id.", nullptr,
1183 eCommandAllowsDummyTarget) {
1191 uint32_t recognizer_id)
override {
1193 if (!recognizer_mgr.SetEnabledForID(recognizer_id,
false)) {
1207 interpreter,
"frame recognizer delete",
1208 "Delete an existing frame recognizer by id.", nullptr,
1209 eCommandAllowsDummyTarget) {
1217 uint32_t recognizer_id)
override {
1219 if (!recognizer_mgr.RemoveRecognizerWithID(recognizer_id)) {
1232 "Show a list of active frame recognizers.", nullptr,
1233 eCommandAllowsDummyTarget) {}
1239 bool any_printed =
false;
1242 &any_printed](uint32_t recognizer_id,
bool enabled, std::string name,
1243 std::string module, llvm::ArrayRef<ConstString> symbols,
1248 name =
"(internal)";
1250 stream << std::to_string(recognizer_id) <<
": ";
1252 symbol_mangling, regexp);
1273 interpreter,
"frame recognizer info",
1274 "Show which frame recognizer is applied a stack frame (if any).",
1275 nullptr, eCommandAllowsDummyTarget) {
1284 uint32_t frame_index;
1285 if (!llvm::to_integer(frame_index_str, frame_index)) {
1292 if (process ==
nullptr) {
1297 if (thread ==
nullptr) {
1303 "'%s' takes exactly one frame index argument",
m_cmd_name.c_str());
1307 StackFrameSP frame_sp = thread->GetStackFrameAtIndex(frame_index);
1318 output_stream.
Printf(
"frame %d ", frame_index);
1320 output_stream <<
"is recognized by ";
1321 output_stream << recognizer->GetName();
1323 output_stream <<
"not recognized by any recognizer";
1325 output_stream.
EOL();
1334 interpreter,
"frame recognizer",
1335 "Commands for editing and viewing frame recognizers.",
1336 "frame recognizer [<sub-command-options>] ") {
1360#pragma mark CommandObjectMultiwordFrame
1367 "Commands for selecting and "
1368 "examining the current "
1369 "thread's stack frames.",
1370 "frame <subcommand> [<subcommand-options>]") {
1379#if LLDB_ENABLE_PYTHON
static void PrintRecognizerDetails(Stream &strm, const std::string &name, bool enabled, const std::string &module, llvm::ArrayRef< lldb_private::ConstString > symbols, Mangled::NamePreference symbol_mangling, bool regexp)
static llvm::raw_ostream & error(Stream &strm)
CommandObjectFrameInfo(CommandInterpreter &interpreter)
void DoExecute(Args &command, CommandReturnObject &result) override
~CommandObjectFrameInfo() override=default
void OptionParsingStarting(ExecutionContext *execution_context) override
std::vector< std::string > m_symbols
bool m_first_instruction_only
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
~CommandOptions() override=default
CommandObjectFrameRecognizerAdd(CommandInterpreter &interpreter)
Options * GetOptions() override
void DoExecute(Args &command, CommandReturnObject &result) override
~CommandObjectFrameRecognizerAdd() override=default
CommandObjectFrameRecognizerClear(CommandInterpreter &interpreter)
~CommandObjectFrameRecognizerClear() override=default
void DoExecute(Args &command, CommandReturnObject &result) override
~CommandObjectFrameRecognizerDelete() override=default
CommandObjectFrameRecognizerDelete(CommandInterpreter &interpreter)
void DoExecuteWithId(CommandReturnObject &result, uint32_t recognizer_id) override
CommandObjectFrameRecognizerDisable(CommandInterpreter &interpreter)
void DoExecuteWithId(CommandReturnObject &result, uint32_t recognizer_id) override
~CommandObjectFrameRecognizerDisable() override=default
void DoExecuteWithId(CommandReturnObject &result, uint32_t recognizer_id) override
CommandObjectFrameRecognizerEnable(CommandInterpreter &interpreter)
~CommandObjectFrameRecognizerEnable() override=default
CommandObjectFrameRecognizerInfo(CommandInterpreter &interpreter)
~CommandObjectFrameRecognizerInfo() override=default
void DoExecute(Args &command, CommandReturnObject &result) override
CommandObjectFrameRecognizerList(CommandInterpreter &interpreter)
~CommandObjectFrameRecognizerList() override=default
void DoExecute(Args &command, CommandReturnObject &result) override
~CommandObjectFrameRecognizer() override=default
CommandObjectFrameRecognizer(CommandInterpreter &interpreter)
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
std::optional< int32_t > relative_frame_offset
void OptionParsingStarting(ExecutionContext *execution_context) override
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
~CommandOptions() override=default
void SkipHiddenFrames(Thread &thread, uint32_t frame_idx)
~CommandObjectFrameSelect() override=default
CommandObjectFrameSelect(CommandInterpreter &interpreter)
Options * GetOptions() override
void DoExecute(Args &command, CommandReturnObject &result) override
OptionGroupOptions m_option_group
OptionGroupFormat m_option_format
Options * GetOptions() override
OptionGroupVariable m_option_variable
OptionGroupValueObjectDisplay m_varobj_options
std::optional< std::string > GetRepeatCommand(Args ¤t_command_args, uint32_t index) override
Get the command that appropriate for a "repeat" of the current command.
bool ScopeRequested(lldb::ValueType scope)
Returns true if scope matches any of the options in m_option_variable.
llvm::StringRef GetScopeString(VariableSP var_sp)
std::optional< llvm::ArrayRef< VariableSP > > findUniqueRegexMatches(RegularExpression ®ex, VariableList &matches, const VariableList &all_variables)
Finds all the variables in all_variables whose name matches regex, inserting them into matches.
~CommandObjectFrameVariable() override=default
CommandObjectFrameVariable(CommandInterpreter &interpreter)
void DoExecute(Args &command, CommandReturnObject &result) override
void DoExecute(Args &command, CommandReturnObject &result) override
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The default version handles argument definitions that have only one argument type,...
CommandObjectWithFrameRecognizerArg(CommandInterpreter &interpreter, const char *name, const char *help=nullptr, const char *syntax=nullptr, uint32_t flags=0)
virtual void DoExecuteWithId(CommandReturnObject &result, uint32_t recognizer_id)=0
A command line argument class.
size_t GetArgumentCount() const
Gets the number of arguments left in this command object.
void AppendArgument(llvm::StringRef arg_str, char quote_char='\0')
Appends a new argument to the end of the list argument list.
const char * GetArgumentAtIndex(size_t idx) const
Gets the NULL terminated C string argument pointer for the argument at index idx.
void InsertArgumentAtIndex(size_t idx, llvm::StringRef arg_str, char quote_char='\0')
Insert the argument value at index idx to arg_str.
bool GetQuotedCommandString(std::string &command) const
CommandObjectMultiwordFrame(CommandInterpreter &interpreter)
~CommandObjectMultiwordFrame() override
bool LoadSubCommand(llvm::StringRef cmd_name, const lldb::CommandObjectSP &command_obj) override
CommandObjectMultiword(CommandInterpreter &interpreter, const char *name, const char *help=nullptr, const char *syntax=nullptr, uint32_t flags=0)
friend class CommandInterpreter
CommandObjectParsed(CommandInterpreter &interpreter, const char *name, const char *help=nullptr, const char *syntax=nullptr, uint32_t flags=0)
virtual void SetHelpLong(llvm::StringRef str)
void AddSimpleArgumentList(lldb::CommandArgumentType arg_type, ArgumentRepetitionType repetition_type=eArgRepeatPlain)
ExecutionContext m_exe_ctx
CommandInterpreter & GetCommandInterpreter()
CommandInterpreter & m_interpreter
Target * GetTarget()
Get the target this command should operate on.
void AppendError(llvm::StringRef in_string)
const ValueObjectList & GetValueObjectList() const
Stream & GetErrorStream()
void SetStatus(lldb::ReturnStatus status)
void SetError(Status error)
void AppendErrorWithFormat(const char *format,...) __attribute__((format(printf
lldb::ReturnStatus GetStatus() const
void AppendWarning(llvm::StringRef in_string)
Stream & GetOutputStream()
"lldb/Utility/ArgCompletionRequest.h"
void TryCompleteCurrentArg(llvm::StringRef completion, llvm::StringRef description="")
Adds a possible completion string if the completion would complete the current argument.
size_t GetCursorIndex() const
A uniqued constant string class.
ScriptInterpreter * GetScriptInterpreter(bool can_create=true, std::optional< lldb::ScriptLanguage > language={})
std::function< bool(ConstString, ConstString, const DumpValueObjectOptions &, Stream &)> DeclPrintingHelper
DumpValueObjectOptions & SetDeclPrintingHelper(DeclPrintingHelper helper)
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
bool IsTopLevelFunction()
Get whether this function represents a 'top-level' function.
A command line option parsing protocol class.
std::vector< Option > m_getopt_table
A plug-in interface definition class for debugging a process.
bool IsValid() const
Test if this object contains a valid regular expression.
bool Execute(llvm::StringRef string, llvm::SmallVectorImpl< llvm::StringRef > *matches=nullptr) const
Execute a regular expression match using the compiled regular expression that is already in this obje...
llvm::Error GetError() const
Return an error if the regular expression failed to compile.
virtual bool CheckObjectExists(const char *name)
Python implementation for frame recognizers.
void AddRecognizer(lldb::StackFrameRecognizerSP recognizer, ConstString module, llvm::ArrayRef< ConstString > symbols, Mangled::NamePreference symbol_mangling, bool first_instruction_only=true)
Add a new recognizer that triggers on a given symbol name.
void ForEach(std::function< void(uint32_t recognizer_id, bool enabled, std::string recognizer_name, std::string module, llvm::ArrayRef< ConstString > symbols, Mangled::NamePreference name_preference, bool regexp)> const &callback)
lldb::StackFrameRecognizerSP GetRecognizerForFrame(lldb::StackFrameSP frame)
void RemoveAllRecognizers()
virtual lldb::ValueObjectSP GetValueForVariableExpressionPath(llvm::StringRef var_expr, lldb::DynamicValueType use_dynamic, uint32_t options, lldb::VariableSP &var_sp, Status &error, lldb::DILMode mode=lldb::eDILModeFull)
Create a ValueObject for a variable name / pathname, possibly including simple dereference/child sele...
@ eExpressionPathOptionCheckPtrVsMember
@ eExpressionPathOptionsInspectAnonymousUnions
@ eExpressionPathOptionsAllowDirectIVarAccess
@ eExpressionPathOptionsAllowVarUpdates
virtual lldb::ValueObjectSP GetValueObjectForFrameVariable(const lldb::VariableSP &variable_sp, lldb::DynamicValueType use_dynamic)
Create a ValueObject for a given Variable in this StackFrame.
virtual VariableList * GetVariableList(bool get_file_globals, bool include_synthetic_vars, Status *error_ptr)
Retrieve the list of variables whose scope either:
virtual const SymbolContext & GetSymbolContext(lldb::SymbolContextItem resolve_scope)
Provide a SymbolContext for this StackFrame's current pc value.
virtual lldb::RecognizedStackFrameSP GetRecognizedFrame()
static Status FromErrorStringWithFormat(const char *format,...) __attribute__((format(printf
static lldb::ValueObjectSP GetCrashingDereference(lldb::StopInfoSP &stop_info_sp, lldb::addr_t *crashing_address=nullptr)
llvm::StringRef GetString() const
A stream class that can stream formatted output to a file.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
virtual void Flush()=0
Flush the stream.
size_t EOL()
Output and End of Line character to the stream.
Function * function
The Function for a given query.
A class that represents statistics for a since lldb_private::Target.
StatsSuccessFail & GetFrameVariableStats()
TargetStats & GetStatistics()
StackFrameRecognizerManager & GetFrameRecognizerManager()
void Append(const lldb::ValueObjectSP &val_obj_sp)
llvm::Error PrintValueObject()
bool AddVariableIfUnique(const lldb::VariableSP &var_sp)
lldb::VariableSP GetVariableAtIndex(size_t idx) const
llvm::ArrayRef< lldb::VariableSP > toArrayRef()
@ SelectMostRelevantFrame
A class that represents a running process on the host machine.
constexpr bool IsSyntheticValueType(lldb::ValueType vt)
Return true if vt represents a synthetic value, false if not.
std::vector< OptionArgElement > OptionElementVector
constexpr lldb::ValueType GetBaseValueType(lldb::ValueType vt)
Get the base value type - for when we don't care if the value is synthetic or not,...
@ eLanguageRuntimeDescriptionDisplayVerbosityFull
std::string toString(FormatterBytecode::OpCodes op)
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
std::shared_ptr< lldb_private::TypeSummaryImpl > TypeSummaryImplSP
std::shared_ptr< lldb_private::CommandObject > CommandObjectSP
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
Format
Display format definitions.
std::shared_ptr< lldb_private::ValueObjectList > ValueObjectListSP
@ eReturnStatusSuccessFinishResult
@ eReturnStatusSuccessFinishNoResult
std::shared_ptr< lldb_private::Variable > VariableSP
@ eValueTypeVTableEntry
function pointer in virtual function table
@ eValueTypeSyntheticFlag
A flag that indicates if the value type is synthetic or not.
@ eValueTypeVTable
virtual function table
@ eValueTypeVariableGlobal
globals variable
@ eValueTypeConstResult
constant result variables
@ eValueTypeVariableLocal
function local variables
@ eValueTypeVariableArgument
function argument variables
@ eValueTypeRegister
stack frame register value
@ eValueTypeVariableStatic
static variable
@ eValueTypeRegisterSet
A collection of stack frame register values.
@ eValueTypeVariableThreadLocal
thread local storage variable
std::shared_ptr< lldb_private::StackFrameRecognizer > StackFrameRecognizerSP
std::shared_ptr< lldb_private::StopInfo > StopInfoSP
static bool ToBoolean(llvm::StringRef s, bool fail_value, bool *success_ptr)