48#pragma mark Modify::CommandOptions
49#define LLDB_OPTIONS_breakpoint_modify
50#include "CommandOptions.inc"
59 return llvm::ArrayRef(g_breakpoint_modify_options);
65 const int short_option =
66 g_breakpoint_modify_options[option_idx].short_option;
67 const char *long_option =
68 g_breakpoint_modify_options[option_idx].long_option;
70 switch (short_option) {
96 uint32_t ignore_count;
97 if (option_arg.getAsInteger(0, ignore_count))
114 if (option_arg ==
"current") {
115 if (!execution_context) {
117 option_arg, short_option, long_option,
118 "No context to determine current thread");
121 if (!ctx_thread_sp || !ctx_thread_sp->IsValid()) {
124 "No currently selected thread");
126 thread_id = ctx_thread_sp->GetID();
129 }
else if (option_arg.getAsInteger(0, thread_id)) {
144 if (option_arg.getAsInteger(0, thread_index)) {
152 llvm_unreachable(
"Unimplemented option");
165 auto cmd_data = std::make_unique<BreakpointOptions::CommandData>();
168 cmd_data->user_source.AppendString(str);
170 cmd_data->stop_on_error =
true;
182#define LLDB_OPTIONS_breakpoint_dummy
183#include "CommandOptions.inc"
192 return llvm::ArrayRef(g_breakpoint_dummy_options);
198 const int short_option =
199 g_breakpoint_dummy_options[option_idx].short_option;
201 switch (short_option) {
206 llvm_unreachable(
"Unimplemented option");
219#define LLDB_OPTIONS_breakpoint_set
220#include "CommandOptions.inc"
239 interpreter,
"breakpoint set",
240 "Sets a breakpoint or set of breakpoints in the executable.",
241 "breakpoint set <cmd-options>"),
267 const int short_option =
268 g_breakpoint_set_options[option_idx].short_option;
269 const char *long_option =
270 g_breakpoint_set_options[option_idx].long_option;
272 switch (short_option) {
288 if (option_arg.getAsInteger(0,
m_column))
297 llvm::StringRef error_context;
313 "Set exception breakpoints separately for c++ and objective-c";
316 error_context =
"Unknown language type for exception breakpoint";
320 if (languagePlugin->SupportsExceptionBreakpointsOnThrow() ||
321 languagePlugin->SupportsExceptionBreakpointsOnCatch()) {
326 error_context =
"Unsupported language type for exception breakpoint";
328 if (!error_context.empty())
330 long_option, error_context);
416 option_arg, short_option, long_option,
"Invalid breakpoint name");
423 option_arg, 0, &
error);
478 llvm_unreachable(
"Unimplemented option");
510 return llvm::ArrayRef(g_breakpoint_set_options);
575 const bool internal =
false;
583 switch (break_type) {
588 if (num_files == 0) {
590 result.
AppendError(
"No file supplied and no default file available.");
593 }
else if (num_files > 1) {
594 result.
AppendError(
"Only one file at a time is allowed for file and "
595 "line breakpoints.");
616 if (num_modules_specified == 1) {
621 }
else if (num_modules_specified == 0) {
625 result.
AppendError(
"Only one shared library can be specified for "
626 "address breakpoints.");
635 if (name_type_mask == 0)
636 name_type_mask = eFunctionNameTypeAuto;
649 if (llvm::Error err = regexp.
GetError()) {
651 "Function name regular expression could not be compiled: %s",
652 llvm::toString(std::move(err)).c_str());
659 "Function name regex does not accept glob patterns.");
677 "No files provided and could not find default file.");
685 if (llvm::Error err = regexp.
GetError()) {
687 "Source text regular expression could not be compiled: \"%s\"",
688 llvm::toString(std::move(err)).c_str());
702 if (precond_error.
Fail()) {
704 "Error setting extra exception arguments: %s",
719 "Error setting extra exception arguments: %s",
error.AsCString());
736 if (name_error.
Fail()) {
748 const bool show_locations =
false;
752 output_stream.
Printf(
"Breakpoint set in dummy target, will get copied "
753 "into future targets.\n");
759 output_stream.
Printf(
"WARNING: Unable to resolve breakpoint to any "
760 "actual locations.\n");
765 result.
AppendError(
"Breakpoint creation failed: No breakpoint created.");
772 uint32_t default_line;
777 if (cur_frame ==
nullptr) {
779 "No selected frame to use to find the default file.");
782 result.
AppendError(
"Cannot use the selected frame to find the default "
783 "file, it has no debug info.");
791 result.
AppendError(
"Can't find the file for the selected frame to "
792 "use as the default file.");
814 "Modify the options on a breakpoint or set of "
815 "breakpoints in the executable. "
816 "If no breakpoint is specified, acts on the last "
817 "created breakpoint. "
818 "With the exception of -e, -d and -i, passing an "
819 "empty argument clears the modification.",
845 std::unique_lock<std::recursive_mutex> lock;
851 command, target, result, &valid_bp_ids,
852 BreakpointName::Permissions::PermissionKinds::disablePerm);
855 const size_t count = valid_bp_ids.
GetSize();
856 for (
size_t i = 0; i < count; ++i) {
890 "Enable the specified disabled breakpoint(s). If "
891 "no breakpoints are specified, enable all of them.",
909 std::unique_lock<std::recursive_mutex> lock;
914 size_t num_breakpoints = breakpoints.
GetSize();
916 if (num_breakpoints == 0) {
917 result.
AppendError(
"No breakpoints exist to be enabled.");
921 if (command.
empty()) {
926 (uint64_t)num_breakpoints);
932 command, target, result, &valid_bp_ids,
933 BreakpointName::Permissions::PermissionKinds::disablePerm);
936 int enable_count = 0;
938 const size_t count = valid_bp_ids.
GetSize();
939 for (
size_t i = 0; i < count; ++i) {
959 enable_count + loc_count);
973 interpreter,
"breakpoint disable",
974 "Disable the specified breakpoint(s) without deleting "
975 "them. If none are specified, disable all "
979 "Disable the specified breakpoint(s) without deleting them. \
980If none are specified, disable all breakpoints."
984 "Note: disabling a breakpoint will cause none of its locations to be hit \
985regardless of whether individual locations are enabled or disabled. After the sequence:"
988 (lldb) break disable 1
989 (lldb) break enable 1.1
991execution will NOT stop at location 1.1. To achieve that, type:
993 (lldb) break disable 1.*
994 (lldb) break enable 1.1
997 "The first command disables all locations for breakpoint 1, \
998the second re-enables the first location.");
1015 std::unique_lock<std::recursive_mutex> lock;
1019 size_t num_breakpoints = breakpoints.
GetSize();
1021 if (num_breakpoints == 0) {
1022 result.
AppendError(
"No breakpoints exist to be disabled.");
1026 if (command.
empty()) {
1031 (uint64_t)num_breakpoints);
1038 command, target, result, &valid_bp_ids,
1039 BreakpointName::Permissions::PermissionKinds::disablePerm);
1042 int disable_count = 0;
1044 const size_t count = valid_bp_ids.
GetSize();
1045 for (
size_t i = 0; i < count; ++i) {
1065 disable_count + loc_count);
1074#pragma mark List::CommandOptions
1075#define LLDB_OPTIONS_breakpoint_list
1076#include "CommandOptions.inc"
1084 interpreter,
"breakpoint list",
1085 "List some or all breakpoints at configurable levels of detail.",
1109 switch (short_option) {
1126 llvm_unreachable(
"Unimplemented option");
1139 return llvm::ArrayRef(g_breakpoint_list_options);
1156 std::unique_lock<std::recursive_mutex> lock;
1159 size_t num_breakpoints = breakpoints.
GetSize();
1161 if (num_breakpoints == 0) {
1169 if (command.
empty()) {
1172 for (
size_t i = 0; i < num_breakpoints; ++i) {
1183 command, target, result, &valid_bp_ids,
1184 BreakpointName::Permissions::PermissionKinds::listPerm);
1187 for (
size_t i = 0; i < valid_bp_ids.
GetSize(); ++i) {
1206#pragma mark Clear::CommandOptions
1208#define LLDB_OPTIONS_breakpoint_clear
1209#include "CommandOptions.inc"
1219 "Delete or disable breakpoints matching the "
1220 "specified source file and line.",
1221 "breakpoint clear <cmd-options>") {}
1238 switch (short_option) {
1248 llvm_unreachable(
"Unimplemented option");
1260 return llvm::ArrayRef(g_breakpoint_clear_options);
1282 std::unique_lock<std::recursive_mutex> lock;
1286 size_t num_breakpoints = breakpoints.
GetSize();
1289 if (num_breakpoints == 0) {
1290 result.
AppendError(
"Breakpoint clear: No breakpoint cleared.");
1297 std::vector<break_id_t> BreakIDs;
1298 for (
size_t i = 0; i < num_breakpoints; ++i)
1301 int num_cleared = 0;
1303 switch (break_type) {
1309 for (
size_t i = 0; i < num_breakpoints; ++i) {
1315 if (loc_coll.
GetSize() == 0) {
1329 if (num_cleared > 0) {
1331 output_stream.
Printf(
"%d breakpoints cleared:\n", num_cleared);
1333 output_stream.
EOL();
1336 result.
AppendError(
"Breakpoint clear: No breakpoint cleared.");
1345#define LLDB_OPTIONS_breakpoint_delete
1346#include "CommandOptions.inc"
1354 "Delete the specified breakpoint(s). If no "
1355 "breakpoints are specified, delete them all.",
1382 switch (short_option) {
1396 llvm_unreachable(
"Unimplemented option");
1409 return llvm::ArrayRef(g_breakpoint_delete_options);
1423 std::unique_lock<std::recursive_mutex> lock;
1428 size_t num_breakpoints = breakpoints.
GetSize();
1430 if (num_breakpoints == 0) {
1431 result.
AppendError(
"No breakpoints exist to be deleted.");
1439 "About to delete all breakpoints, do you want to do that?",
1445 "All breakpoints removed. (%" PRIu64
" breakpoint%s)\n",
1446 (uint64_t)num_breakpoints, num_breakpoints > 1 ?
"s" :
"");
1460 if (!command.
empty()) {
1462 command, target, result, &excluded_bp_ids,
1463 BreakpointName::Permissions::PermissionKinds::deletePerm);
1468 for (
auto breakpoint_sp : breakpoints.
Breakpoints()) {
1469 if (!breakpoint_sp->IsEnabled() && breakpoint_sp->AllowDelete()) {
1471 if (!excluded_bp_ids.
Contains(bp_id))
1475 if (valid_bp_ids.
GetSize() == 0) {
1481 command, target, result, &valid_bp_ids,
1482 BreakpointName::Permissions::PermissionKinds::deletePerm);
1487 int delete_count = 0;
1488 int disable_count = 0;
1489 const size_t count = valid_bp_ids.
GetSize();
1490 for (
size_t i = 0; i < count; ++i) {
1512 "%d breakpoints deleted; %d breakpoint locations disabled.\n",
1513 delete_count, disable_count);
1522#define LLDB_OPTIONS_breakpoint_name
1523#include "CommandOptions.inc"
1533 return llvm::ArrayRef(g_breakpoint_name_options);
1539 const int short_option = g_breakpoint_name_options[option_idx].short_option;
1540 const char *long_option = g_breakpoint_name_options[option_idx].long_option;
1542 switch (short_option) {
1563 llvm_unreachable(
"Unimplemented option");
1582#define LLDB_OPTIONS_breakpoint_access
1583#include "CommandOptions.inc"
1592 return llvm::ArrayRef(g_breakpoint_access_options);
1597 const int short_option =
1598 g_breakpoint_access_options[option_idx].short_option;
1599 const char *long_option =
1600 g_breakpoint_access_options[option_idx].long_option;
1602 switch (short_option) {
1604 bool value, success;
1613 bool value, success;
1622 bool value, success;
1631 llvm_unreachable(
"Unimplemented option");
1649 interpreter,
"configure",
1650 "Configure the options for the breakpoint"
1652 "If you provide a breakpoint id, the options will be copied from "
1653 "the breakpoint, otherwise only the options specified will be set "
1655 "breakpoint name configure <command-options> "
1656 "<breakpoint-name-list>") {
1682 std::unique_lock<std::recursive_mutex> lock;
1686 for (
auto &entry : command.
entries()) {
1690 entry.c_str(),
error.AsCString());
1709 for (
auto &entry : command.
entries()) {
1741 interpreter,
"add",
"Add a name to the breakpoints provided.",
1742 "breakpoint name add <command-options> <breakpoint-id-list>") {
1770 std::unique_lock<std::recursive_mutex> lock;
1775 size_t num_breakpoints = breakpoints.
GetSize();
1776 if (num_breakpoints == 0) {
1777 result.
AppendError(
"No breakpoints, cannot add names.");
1784 command, target, result, &valid_bp_ids,
1785 BreakpointName::Permissions::PermissionKinds::listPerm);
1788 if (valid_bp_ids.
GetSize() == 0) {
1789 result.
AppendError(
"No breakpoints specified, cannot add names.");
1792 size_t num_valid_ids = valid_bp_ids.
GetSize();
1796 for (
size_t index = 0; index < num_valid_ids; index++) {
1814 interpreter,
"delete",
1815 "Delete a name from the breakpoints provided.",
1816 "breakpoint name delete <command-options> <breakpoint-id-list>") {
1844 std::unique_lock<std::recursive_mutex> lock;
1849 size_t num_breakpoints = breakpoints.
GetSize();
1850 if (num_breakpoints == 0) {
1851 result.
AppendError(
"No breakpoints, cannot delete names.");
1858 command, target, result, &valid_bp_ids,
1859 BreakpointName::Permissions::PermissionKinds::deletePerm);
1862 if (valid_bp_ids.
GetSize() == 0) {
1863 result.
AppendError(
"No breakpoints specified, cannot delete names.");
1867 size_t num_valid_ids = valid_bp_ids.
GetSize();
1868 for (
size_t index = 0; index < num_valid_ids; index++) {
1886 "List either the names for a breakpoint or info "
1887 "about a given name. With no arguments, lists all "
1889 "breakpoint name list <command-options>") {
1903 std::vector<std::string> name_list;
1904 if (command.
empty()) {
1908 name_list.push_back(arg.c_str());
1912 if (name_list.empty()) {
1915 for (
const std::string &name_str : name_list) {
1916 const char *name = name_str.c_str();
1928 std::unique_lock<std::recursive_mutex> lock;
1932 bool any_set =
false;
1934 if (bp_sp->MatchesName(name)) {
1961 interpreter,
"name",
"Commands to manage breakpoint names") {
1966Breakpoint names provide a general tagging mechanism for breakpoints. Each
1967breakpoint name can be added to any number of breakpoints, and each breakpoint
1968can have any number of breakpoint names attached to it. For instance:
1970 (lldb) break name add -N MyName 1-10
1972adds the name MyName to breakpoints 1-10, and:
1974 (lldb) break set -n myFunc -N Name1 -N Name2
1976adds two names to the breakpoint set at myFunc.
1978They have a number of interrelated uses:
19801) They provide a stable way to refer to a breakpoint (e.g. in another
1981breakpoint's action). Using the breakpoint ID for this purpose is fragile, since
1982it depends on the order of breakpoint creation. Giving a name to the breakpoint
1983you want to act on, and then referring to it by name, is more robust:
1985 (lldb) break set -n myFunc -N BKPT1
1986 (lldb) break set -n myOtherFunc -C "break disable BKPT1"
19882) This is actually just a specific use of a more general feature of breakpoint
1989names. The <breakpt-id-list> argument type used to specify one or more
1990breakpoints in most of the commands that deal with breakpoints also accepts
1991breakpoint names. That allows you to refer to one breakpoint in a stable
1992manner, but also makes them a convenient grouping mechanism, allowing you to
1993easily act on a group of breakpoints by using their name, for instance disabling
1994them all in one action:
1996 (lldb) break set -n myFunc -N Group1
1997 (lldb) break set -n myOtherFunc -N Group1
1998 (lldb) break disable Group1
20003) But breakpoint names are also entities in their own right, and can be
2001configured with all the modifiable attributes of a breakpoint. Then when you
2002add a breakpoint name to a breakpoint, the breakpoint will be configured to
2003match the state of the breakpoint name. The link between the name and the
2004breakpoints sharing it remains live, so if you change the configuration on the
2005name, it will also change the configurations on the breakpoints:
2007 (lldb) break name configure -i 10 IgnoreSome
2008 (lldb) break set -n myFunc -N IgnoreSome
2009 (lldb) break list IgnoreSome
2010 2: name = 'myFunc', locations = 0 (pending) Options: ignore: 10 enabled
2013 (lldb) break name configure -i 5 IgnoreSome
2014 (lldb) break list IgnoreSome
2015 2: name = 'myFunc', locations = 0 (pending) Options: ignore: 5 enabled
2019Options that are not configured on a breakpoint name don't affect the value of
2020those options on the breakpoints they are added to. So for instance, if Name1
2021has the -i option configured and Name2 the -c option, adding both names to a
2022breakpoint will set the -i option from Name1 and the -c option from Name2, and
2023the other options will be unaltered.
2025If you add multiple names to a breakpoint which have configured values for
2026the same option, the last name added's value wins.
2028The "liveness" of these settings is one way, from name to breakpoint.
2029If you use "break modify" to change an option that is also configured on a name
2030which that breakpoint has, the "break modify" command will override the setting
2031for that breakpoint, but won't change the value configured in the name or on the
2032other breakpoints sharing that name.
20344) Breakpoint names are also a convenient way to copy option sets from one
2035breakpoint to another. Using the -B option to "breakpoint name configure" makes
2036a name configured with all the options of the original breakpoint. Then
2037adding that name to another breakpoint copies over all the values from the
2038original breakpoint to the new one.
20405) You can also use breakpoint names to hide breakpoints from the breakpoint
2041operations that act on all breakpoints: "break delete", "break disable" and
2042"break list". You do that by specifying a "false" value for the
2043--allow-{list,delete,disable} options to "breakpoint name configure" and then
2044adding that name to a breakpoint.
2046This won't keep the breakpoint from being deleted or disabled if you refer to it
2047specifically by ID. The point of the feature is to make sure users don't
2048inadvertently delete or disable useful breakpoints (e.g. ones an IDE is using
2049for its own purposes) as part of a "delete all" or "disable all" operation. The
2050list hiding is because it's confusing for people to see breakpoints they
2073#pragma mark Read::CommandOptions
2074#define LLDB_OPTIONS_breakpoint_read
2075#include "CommandOptions.inc"
2083 "Read and set the breakpoints previously saved to "
2084 "a file with \"breakpoint write\". ",
2101 const char *long_option =
2104 switch (short_option) {
2115 m_names.push_back(std::string(option_arg));
2119 llvm_unreachable(
"Unimplemented option");
2131 return llvm::ArrayRef(g_breakpoint_read_options);
2137 int opt_arg_pos = opt_element_vector[opt_element_index].opt_arg_pos;
2138 int opt_defs_index = opt_element_vector[opt_element_index].opt_defs_index;
2147 std::optional<FileSpec> file_spec;
2148 const llvm::StringRef dash_f(
"-f");
2149 for (
int arg_idx = 0; arg_idx < opt_arg_pos; arg_idx++) {
2163 if (!
error.Success())
2170 const size_t num_bkpts = bkpt_array->
GetSize();
2171 for (
size_t i = 0; i < num_bkpts; i++) {
2174 if (!bkpt_object_sp)
2196 size_t num_names = names_array->
GetSize();
2198 for (
size_t i = 0; i < num_names; i++) {
2199 if (std::optional<llvm::StringRef> maybe_name =
2215 std::unique_lock<std::recursive_mutex> lock;
2224 if (!
error.Success()) {
2231 size_t num_breakpoints = new_bps.
GetSize();
2232 if (num_breakpoints == 0) {
2237 for (
size_t i = 0; i < num_breakpoints; ++i) {
2254#pragma mark Write::CommandOptions
2255#define LLDB_OPTIONS_breakpoint_write
2256#include "CommandOptions.inc"
2263 "Write the breakpoints listed to a file that can "
2264 "be read in with \"breakpoint read\". "
2265 "If given no arguments, writes all breakpoints.",
2292 switch (short_option) {
2300 llvm_unreachable(
"Unimplemented option");
2312 return llvm::ArrayRef(g_breakpoint_write_options);
2325 std::unique_lock<std::recursive_mutex> lock;
2329 if (!command.
empty()) {
2331 command, target, result, &valid_bp_ids,
2332 BreakpointName::Permissions::PermissionKinds::listPerm);
2343 if (!
error.Success()) {
2354#pragma mark MultiwordBreakpoint
2359 interpreter,
"breakpoint",
2360 "Commands for operating on breakpoints (see 'help b' for shorthand.)",
2361 "breakpoint <subcommand> [<command-options>]") {
2385 list_command_object->SetCommandName(
"breakpoint list");
2386 enable_command_object->SetCommandName(
"breakpoint enable");
2387 disable_command_object->SetCommandName(
"breakpoint disable");
2388 clear_command_object->SetCommandName(
"breakpoint clear");
2389 delete_command_object->SetCommandName(
"breakpoint delete");
2390 set_command_object->SetCommandName(
"breakpoint set");
2391 command_command_object->SetCommandName(
"breakpoint command");
2392 modify_command_object->SetCommandName(
"breakpoint modify");
2393 name_command_object->SetCommandName(
"breakpoint name");
2394 write_command_object->SetCommandName(
"breakpoint write");
2395 read_command_object->SetCommandName(
"breakpoint read");
2413 Args &args,
Target &target,
bool allow_locations,
2415 BreakpointName::Permissions ::PermissionKinds purpose) {
2436 "No breakpoint specified and no last created breakpoint.");
2448 args, &target, allow_locations, purpose, temp_args)) {
2468 const size_t count = valid_ids->
GetSize();
2469 for (
size_t i = 0; i < count; ++i) {
2473 if (breakpoint !=
nullptr) {
2475 if (
static_cast<size_t>(cur_bp_id.
GetLocationID()) > num_locations) {
2481 "'%s' is not a currently valid breakpoint/location id.\n",
2487 "'%d' is not a currently valid breakpoint ID.\n",
static void AddBreakpointDescription(Stream *s, Breakpoint *bp, lldb::DescriptionLevel level)
static llvm::raw_ostream & error(Stream &strm)
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
BreakpointAccessOptionGroup()=default
const BreakpointName::Permissions & GetPermissions() const
~BreakpointAccessOptionGroup() override=default
BreakpointName::Permissions m_permissions
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
void OptionParsingStarting(ExecutionContext *execution_context) override
BreakpointDummyOptionGroup()=default
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
void OptionParsingStarting(ExecutionContext *execution_context) override
~BreakpointDummyOptionGroup() override=default
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
OptionValueBoolean m_use_dummy
BreakpointNameOptionGroup()
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
OptionValueString m_help_string
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
~BreakpointNameOptionGroup() override=default
void OptionParsingStarting(ExecutionContext *execution_context) override
OptionValueUInt64 m_breakpoint
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
~CommandOptions() override=default
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
void OptionParsingStarting(ExecutionContext *execution_context) override
void DoExecute(Args &command, CommandReturnObject &result) override
Options * GetOptions() override
CommandObjectBreakpointClear(CommandInterpreter &interpreter)
~CommandObjectBreakpointClear() override=default
void OptionParsingStarting(ExecutionContext *execution_context) override
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
~CommandOptions() override=default
CommandObjectBreakpointDelete(CommandInterpreter &interpreter)
~CommandObjectBreakpointDelete() override=default
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The default version handles argument definitions that have only one argument type,...
Options * GetOptions() override
void DoExecute(Args &command, CommandReturnObject &result) override
~CommandObjectBreakpointDisable() override=default
CommandObjectBreakpointDisable(CommandInterpreter &interpreter)
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,...
~CommandObjectBreakpointEnable() override=default
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The default version handles argument definitions that have only one argument type,...
CommandObjectBreakpointEnable(CommandInterpreter &interpreter)
void DoExecute(Args &command, CommandReturnObject &result) override
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
~CommandOptions() override=default
void OptionParsingStarting(ExecutionContext *execution_context) override
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
lldb::DescriptionLevel m_level
~CommandObjectBreakpointList() override=default
Options * GetOptions() override
void DoExecute(Args &command, CommandReturnObject &result) override
CommandObjectBreakpointList(CommandInterpreter &interpreter)
void DoExecute(Args &command, CommandReturnObject &result) override
BreakpointDummyOptionGroup m_dummy_opts
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The default version handles argument definitions that have only one argument type,...
CommandObjectBreakpointModify(CommandInterpreter &interpreter)
BreakpointOptionGroup m_bp_opts
~CommandObjectBreakpointModify() override=default
OptionGroupOptions m_options
Options * GetOptions() override
void DoExecute(Args &command, CommandReturnObject &result) override
OptionGroupOptions m_option_group
CommandObjectBreakpointNameAdd(CommandInterpreter &interpreter)
Options * GetOptions() override
~CommandObjectBreakpointNameAdd() override=default
BreakpointNameOptionGroup m_name_options
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The default version handles argument definitions that have only one argument type,...
BreakpointNameOptionGroup m_name_options
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The default version handles argument definitions that have only one argument type,...
CommandObjectBreakpointNameDelete(CommandInterpreter &interpreter)
Options * GetOptions() override
void DoExecute(Args &command, CommandReturnObject &result) override
~CommandObjectBreakpointNameDelete() override=default
OptionGroupOptions m_option_group
CommandObjectBreakpointNameList(CommandInterpreter &interpreter)
void DoExecute(Args &command, CommandReturnObject &result) override
Options * GetOptions() override
OptionGroupOptions m_option_group
~CommandObjectBreakpointNameList() override=default
BreakpointNameOptionGroup m_name_options
~CommandObjectBreakpointName() override=default
CommandObjectBreakpointName(CommandInterpreter &interpreter)
void HandleOptionArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector, int opt_element_index, CommandInterpreter &interpreter) override
Handles the generic bits of figuring out whether we are in an option, and if so completing it.
std::vector< std::string > m_names
~CommandOptions() override=default
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
void OptionParsingStarting(ExecutionContext *execution_context) override
void DoExecute(Args &command, CommandReturnObject &result) override
CommandObjectBreakpointRead(CommandInterpreter &interpreter)
Options * GetOptions() override
~CommandObjectBreakpointRead() override=default
lldb::LanguageType m_language
void OptionParsingStarting(ExecutionContext *execution_context) override
std::string m_func_regexp
std::string m_source_text_regexp
std::vector< std::string > m_breakpoint_names
~CommandOptions() override=default
Args m_exception_extra_args
std::string m_current_key
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
lldb::LanguageType m_exception_language
lldb::addr_t m_offset_addr
LazyBool m_move_to_nearest_code
lldb::FunctionNameType m_func_name_type_mask
std::vector< std::string > m_func_names
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
std::unordered_set< std::string > m_source_regex_func_names
OptionGroupOptions m_all_options
~CommandObjectBreakpointSet() override=default
BreakpointOptionGroup m_bp_opts
bool GetDefaultFile(Target &target, FileSpec &file, CommandReturnObject &result)
void DoExecute(Args &command, CommandReturnObject &result) override
Options * GetOptions() override
OptionGroupPythonClassWithDict m_python_class_options
CommandObjectBreakpointSet(CommandInterpreter &interpreter)
BreakpointDummyOptionGroup m_dummy_options
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
void OptionParsingStarting(ExecutionContext *execution_context) override
~CommandOptions() override=default
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
void DoExecute(Args &command, CommandReturnObject &result) override
Options * GetOptions() override
void HandleArgumentCompletion(CompletionRequest &request, OptionElementVector &opt_element_vector) override
The default version handles argument definitions that have only one argument type,...
CommandObjectBreakpointWrite(CommandInterpreter &interpreter)
~CommandObjectBreakpointWrite() override=default
A command line argument class.
llvm::ArrayRef< const char * > GetArgumentArrayRef() const
Gets the argument as an ArrayRef.
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.
llvm::ArrayRef< ArgEntry > entries() const
const char * GetArgumentAtIndex(size_t idx) const
Gets the NULL terminated C string argument pointer for the argument at index idx.
void Clear()
Clear the arguments.
bool Contains(BreakpointID bp_id) const
bool AddBreakpointID(BreakpointID bp_id)
BreakpointID GetBreakpointIDAtIndex(size_t index) const
static llvm::Error FindAndReplaceIDRanges(Args &old_args, Target *target, bool allow_locations, BreakpointName::Permissions ::PermissionKinds purpose, Args &new_args)
static std::optional< BreakpointID > ParseCanonicalReference(llvm::StringRef input)
Takes an input string containing the description of a breakpoint or breakpoint and location and retur...
lldb::break_id_t GetBreakpointID() const
lldb::break_id_t GetLocationID() const
static void GetCanonicalReference(Stream *s, lldb::break_id_t break_id, lldb::break_id_t break_loc_id)
Takes a breakpoint ID and the breakpoint location id and returns a string containing the canonical de...
static bool StringIsBreakpointName(llvm::StringRef str, Status &error)
Takes an input string and checks to see whether it is a breakpoint name.
General Outline: Allows adding and removing breakpoints and find by ID and index.
BreakpointIterable Breakpoints()
lldb::BreakpointSP FindBreakpointByID(lldb::break_id_t breakID) const
Returns a shared pointer to the breakpoint with id breakID.
void GetListMutex(std::unique_lock< std::recursive_mutex > &lock)
Sets the passed in Locker to hold the Breakpoint List mutex.
size_t GetSize() const
Returns the number of elements in this breakpoint list.
lldb::BreakpointSP GetBreakpointAtIndex(size_t i) const
Returns a shared pointer to the breakpoint with index i.
size_t GetSize() const
Returns the number of elements in this breakpoint location list.
General Outline: A breakpoint location is defined by the breakpoint that produces it,...
BreakpointOptions & GetLocationOptions()
Use this to set location specific breakpoint options.
void SetEnabled(bool enabled)
If enabled is true, enable the breakpoint, if false disable it.
bool SetAllowDisable(bool value)
bool SetAllowList(bool value)
bool SetAllowDelete(bool value)
bool GetDescription(Stream *s, lldb::DescriptionLevel level)
void SetHelp(const char *description)
BreakpointOptions & GetOptions()
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
Status OptionParsingFinished(ExecutionContext *execution_context) override
const BreakpointOptions & GetBreakpointOptions()
BreakpointOptions m_bp_opts
std::vector< std::string > m_commands
~BreakpointOptionGroup() override=default
void OptionParsingStarting(ExecutionContext *execution_context) override
"lldb/Breakpoint/BreakpointOptions.h" Class that manages the options on a breakpoint or breakpoint lo...
Flags m_set_flags
Which options are set at this level.
void SetIgnoreCount(uint32_t n)
Set the breakpoint to ignore the next count breakpoint hits.
void SetEnabled(bool enabled)
If enable is true, enable the breakpoint, if false disable it.
void SetCondition(const char *condition)
Set the breakpoint option's condition.
ThreadSpec * GetThreadSpec()
Returns a pointer to the ThreadSpec for this option, creating it.
void SetOneShot(bool one_shot)
If enable is true, enable the breakpoint, if false disable it.
void SetAutoContinue(bool auto_continue)
Set the auto-continue state.
void SetThreadID(lldb::tid_t thread_id)
void CopyOverSetOptions(const BreakpointOptions &rhs)
Copy over only the options set in the incoming BreakpointOptions.
void SetCommandDataCallback(std::unique_ptr< CommandData > &cmd_data)
Set a callback based on BreakpointOptions::CommandData.
General Outline: A breakpoint has four main parts, a filter, a resolver, the list of breakpoint locat...
void GetDescription(Stream *s, lldb::DescriptionLevel level, bool show_locations=false)
Put a description of this breakpoint into the stream s.
BreakpointOptions & GetOptions()
Returns the BreakpointOptions structure set at the breakpoint level.
static const char * GetSerializationKey()
bool GetMatchingFileLine(ConstString filename, uint32_t line_number, BreakpointLocationCollection &loc_coll)
Find breakpoint locations which match the (filename, line_number) description.
lldb::BreakpointLocationSP FindLocationByID(lldb::break_id_t bp_loc_id)
Find a breakpoint location for a given breakpoint location ID.
size_t GetNumLocations() const
Return the number of breakpoint locations.
void SetEnabled(bool enable) override
If enable is true, enable the breakpoint, if false disable it.
static bool InvokeCommonCompletionCallbacks(CommandInterpreter &interpreter, uint32_t completion_mask, lldb_private::CompletionRequest &request, SearchFilter *searcher)
bool Confirm(llvm::StringRef message, bool default_answer)
static void VerifyIDs(Args &args, Target &target, bool allow_locations, CommandReturnObject &result, BreakpointIDList *valid_ids, BreakpointName::Permissions::PermissionKinds purpose)
static void VerifyBreakpointOrLocationIDs(Args &args, Target &target, CommandReturnObject &result, BreakpointIDList *valid_ids, BreakpointName::Permissions ::PermissionKinds purpose)
CommandObjectMultiwordBreakpoint(CommandInterpreter &interpreter)
~CommandObjectMultiwordBreakpoint() override
static void VerifyBreakpointIDs(Args &args, Target &target, CommandReturnObject &result, BreakpointIDList *valid_ids, BreakpointName::Permissions::PermissionKinds purpose)
bool LoadSubCommand(llvm::StringRef cmd_name, const lldb::CommandObjectSP &command_obj) override
std::vector< CommandArgumentData > CommandArgumentEntry
virtual void SetHelpLong(llvm::StringRef str)
void AddSimpleArgumentList(lldb::CommandArgumentType arg_type, ArgumentRepetitionType repetition_type=eArgRepeatPlain)
Target & GetDummyTarget()
ExecutionContext m_exe_ctx
void AddIDsArgumentData(IDType type)
CommandInterpreter & GetCommandInterpreter()
CommandInterpreter & m_interpreter
void AppendErrorWithFormatv(const char *format, Args &&... args)
void AppendMessage(llvm::StringRef in_string)
void void AppendError(llvm::StringRef in_string)
void SetStatus(lldb::ReturnStatus status)
void AppendErrorWithFormat(const char *format,...) __attribute__((format(printf
void AppendMessageWithFormat(const char *format,...) __attribute__((format(printf
void void AppendWarning(llvm::StringRef in_string)
void SetError(const Status &error, const char *fallback_error_cstr=nullptr)
Stream & GetOutputStream()
"lldb/Utility/ArgCompletionRequest.h"
const Args & GetParsedLine() const
void TryCompleteCurrentArg(llvm::StringRef completion, llvm::StringRef description="")
Adds a possible completion string if the completion would complete the current argument.
A uniqued constant string class.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
StackFrame * GetFramePtr() const
Returns a pointer to the frame object.
const lldb::ThreadSP & GetThreadSP() const
Get accessor to get the thread shared pointer.
const FileSpec & GetFileSpecAtIndex(size_t idx) const
Get file at index.
void Clear()
Clears the file list.
void Append(const FileSpec &file)
Append a FileSpec object to the list.
size_t GetSize() const
Get the number of files in the file list.
bool AppendIfUnique(const FileSpec &file)
Append a FileSpec object if unique.
void Resolve(llvm::SmallVectorImpl< char > &path)
Resolve path to make it canonical.
static FileSystem & Instance()
ValueType Set(ValueType mask)
Set one or more flags by logical OR'ing mask with the current flags.
static Language * FindPlugin(lldb::LanguageType language)
static lldb::LanguageType GetLanguageTypeFromString(const char *string)=delete
void Append(OptionGroup *group)
Append options from a OptionGroup class.
const std::string & GetName()
const StructuredData::DictionarySP GetStructuredData()
void SetDefaultValue(bool value)
Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign) override
uint32_t GetColumnNumber()
Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign) override
Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign) override
const char * GetCurrentValue() const
Status SetValueFromString(llvm::StringRef value, VarSetOperationType op=eVarSetOperationAssign) override
bool OptionWasSet() const
std::optional< T > GetValueAs() const
A command line option parsing protocol class.
std::vector< Option > m_getopt_table
llvm::Error GetError() const
Return an error if the regular expression failed to compile.
bool GetDefaultFileAndLine(FileSpec &file_spec, uint32_t &line)
This base class provides an interface to stack frames.
const SymbolContext & GetSymbolContext(lldb::SymbolContextItem resolve_scope)
Provide a SymbolContext for this StackFrame's current pc value.
bool HasDebugInformation()
Determine whether this StackFrame has debug information available or not.
bool Fail() const
Test for error condition.
const char * AsCString(const char *default_error_str="unknown error") const
Get the error string associated with the current error.
bool Success() const
Test for success condition.
lldb::break_id_t GetID() const
const char * GetData() const
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 EOL()
Output and End of Line character to the stream.
void IndentLess(unsigned amount=2)
Decrement the current indentation level.
void IndentMore(unsigned amount=2)
Increment the current indentation level.
ObjectSP GetItemAtIndex(size_t idx) const
std::optional< llvm::StringRef > GetItemAtIndexAsString(size_t idx) const
ObjectSP GetValueForKey(llvm::StringRef key) const
bool GetValueForKeyAsArray(llvm::StringRef key, Array *&result) const
Dictionary * GetAsDictionary()
std::shared_ptr< Object > ObjectSP
static ObjectSP ParseJSONFromFile(const FileSpec &file, Status &error)
Defines a symbol context baton that can be handed other debug core functions.
LineEntry line_entry
The LineEntry for a given query.
lldb::BreakpointSP CreateScriptedBreakpoint(const llvm::StringRef class_name, const FileSpecList *containingModules, const FileSpecList *containingSourceFiles, bool internal, bool request_hardware, StructuredData::ObjectSP extra_args_sp, Status *creation_error=nullptr)
lldb::BreakpointSP CreateFuncRegexBreakpoint(const FileSpecList *containingModules, const FileSpecList *containingSourceFiles, RegularExpression func_regexp, lldb::LanguageType requested_language, LazyBool skip_prologue, bool internal, bool request_hardware)
lldb::BreakpointSP GetBreakpointByID(lldb::break_id_t break_id)
BreakpointList & GetBreakpointList(bool internal=false)
SourceManager & GetSourceManager()
void AddNameToBreakpoint(BreakpointID &id, llvm::StringRef name, Status &error)
void DisableAllowedBreakpoints()
bool RemoveBreakpointByID(lldb::break_id_t break_id)
BreakpointName * FindBreakpointName(ConstString name, bool can_create, Status &error)
void ConfigureBreakpointName(BreakpointName &bp_name, const BreakpointOptions &options, const BreakpointName::Permissions &permissions)
Status SerializeBreakpointsToFile(const FileSpec &file, const BreakpointIDList &bp_ids, bool append)
lldb::BreakpointSP CreateExceptionBreakpoint(enum lldb::LanguageType language, bool catch_bp, bool throw_bp, bool internal, Args *additional_args=nullptr, Status *additional_args_error=nullptr)
void EnableAllowedBreakpoints()
void RemoveAllowedBreakpoints()
lldb::BreakpointSP CreateAddressInModuleBreakpoint(lldb::addr_t file_addr, bool internal, const FileSpec &file_spec, bool request_hardware)
lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules, const FileSpec &file, uint32_t line_no, uint32_t column, lldb::addr_t offset, LazyBool check_inlines, LazyBool skip_prologue, bool internal, bool request_hardware, LazyBool move_to_nearest_code)
lldb::BreakpointSP CreateSourceRegexBreakpoint(const FileSpecList *containingModules, const FileSpecList *source_file_list, const std::unordered_set< std::string > &function_names, RegularExpression source_regex, bool internal, bool request_hardware, LazyBool move_to_nearest_code)
void GetBreakpointNames(std::vector< std::string > &names)
Status CreateBreakpointsFromFile(const FileSpec &file, BreakpointIDList &new_bps)
void RemoveNameFromBreakpoint(lldb::BreakpointSP &bp_sp, ConstString name)
lldb::BreakpointSP GetLastCreatedBreakpoint()
void SetIndex(uint32_t index)
void SetName(llvm::StringRef name)
void SetQueueName(llvm::StringRef queue_name)
#define LLDB_INVALID_BREAK_ID
#define LLDB_INVALID_THREAD_ID
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
std::vector< OptionArgElement > OptionElementVector
static constexpr llvm::StringLiteral g_bool_parsing_error_message
static constexpr llvm::StringLiteral g_int_parsing_error_message
llvm::Error CreateOptionParsingError(llvm::StringRef option_arg, const char short_option, llvm::StringRef long_option={}, llvm::StringRef additional_context={})
Creates an error that represents the failure to parse an command line option argument.
static constexpr llvm::StringLiteral g_language_parsing_error_message
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
@ eDescriptionLevelInitial
@ eDescriptionLevelVerbose
std::shared_ptr< lldb_private::Thread > ThreadSP
std::shared_ptr< lldb_private::CommandObject > CommandObjectSP
LanguageType
Programming language type.
@ eLanguageTypeC_plus_plus_14
ISO C++:2014.
@ eLanguageTypeC11
ISO C:2011.
@ eLanguageTypeC99
ISO C:1999.
@ eLanguageTypeC_plus_plus_03
ISO C++:2003.
@ eLanguageTypeUnknown
Unknown or invalid language value.
@ eLanguageTypeObjC_plus_plus
Objective-C++.
@ eLanguageTypeC_plus_plus_11
ISO C++:2011.
@ eLanguageTypeC89
ISO C:1989.
@ eLanguageTypeC
Non-standardized C, such as K&R.
@ eLanguageTypeC_plus_plus
ISO C++:1998.
std::shared_ptr< lldb_private::Breakpoint > BreakpointSP
@ eReturnStatusSuccessFinishResult
@ eReturnStatusSuccessFinishNoResult
Used to build individual command argument lists.
const FileSpec & GetFile() const
Helper to access the file.
static lldb::addr_t ToAddress(const ExecutionContext *exe_ctx, llvm::StringRef s, lldb::addr_t fail_value, Status *error_ptr)
Try to parse an address.
static bool ToBoolean(llvm::StringRef s, bool fail_value, bool *success_ptr)