LLDB mainline
CommandObjectBreakpointCommand.cpp
Go to the documentation of this file.
1//===-- CommandObjectBreakpointCommand.cpp --------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
14#include "lldb/Core/IOHandler.h"
21#include "lldb/Target/Target.h"
22
23using namespace lldb;
24using namespace lldb_private;
25
26#define LLDB_OPTIONS_breakpoint_command_add
27#include "CommandOptions.inc"
28
31public:
33 : CommandObjectParsed(interpreter, "add",
34 "Add LLDB commands to a breakpoint, to be executed "
35 "whenever the breakpoint is hit. "
36 "The commands added to the breakpoint replace any "
37 "commands previously added to it."
38 " If no breakpoint is specified, adds the "
39 "commands to the last created breakpoint.",
40 nullptr),
43 m_func_options("breakpoint command", false, 'F') {
45 R"(
46General information about entering breakpoint commands
47------------------------------------------------------
48
49)"
50 "This command will prompt for commands to be executed when the specified \
51breakpoint is hit. Each command is typed on its own line following the '> ' \
52prompt until 'DONE' is entered."
53 R"(
54
55)"
56 "Syntactic errors may not be detected when initially entered, and many \
57malformed commands can silently fail when executed. If your breakpoint commands \
58do not appear to be executing, double-check the command syntax."
59 R"(
60
61)"
62 "Note: You may enter any debugger command exactly as you would at the debugger \
63prompt. There is no limit to the number of commands supplied, but do NOT enter \
64more than one command per line."
65 R"(
66
67Special information about PYTHON breakpoint commands
68----------------------------------------------------
69
70)"
71 "You may enter either one or more lines of Python, including function \
72definitions or calls to functions that will have been imported by the time \
73the code executes. Single line breakpoint commands will be interpreted 'as is' \
74when the breakpoint is hit. Multiple lines of Python will be wrapped in a \
75generated function, and a call to the function will be attached to the breakpoint."
76 R"(
77
78This auto-generated function is passed in three arguments:
79
80 frame: an lldb.SBFrame object for the frame which hit breakpoint.
81
82 bp_loc: an lldb.SBBreakpointLocation object that represents the breakpoint location that was hit.
83
84 dict: the python session dictionary hit.
85
86)"
87 "When specifying a python function with the --python-function option, you need \
88to supply the function name prepended by the module name:"
89 R"(
90
91 --python-function myutils.breakpoint_callback
92
93The function itself must have either of the following prototypes:
94
95def breakpoint_callback(frame, bp_loc, internal_dict):
96 # Your code goes here
97
98or:
99
100def breakpoint_callback(frame, bp_loc, extra_args, internal_dict):
101 # Your code goes here
103)"
104 "The arguments are the same as the arguments passed to generated functions as \
105described above. In the second form, any -k and -v pairs provided to the command will \
106be packaged into a SBDictionary in an SBStructuredData and passed as the extra_args parameter. \
107\n\n\
108Note that the global variable 'lldb.frame' will NOT be updated when \
109this function is called, so be sure to use the 'frame' argument. The 'frame' argument \
110can get you to the thread via frame.GetThread(), the thread can get you to the \
111process via thread.GetProcess(), and the process can get you back to the target \
112via process.GetTarget()."
113 R"(
115)"
116 "Important Note: As Python code gets collected into functions, access to global \
117variables requires explicit scoping using the 'global' keyword. Be sure to use correct \
118Python syntax, including indentation, when entering Python breakpoint commands."
119 R"(
120
121Example Python one-line breakpoint command:
122
123(lldb) breakpoint command add -s python 1
124Enter your Python command(s). Type 'DONE' to end.
125def function (frame, bp_loc, internal_dict):
126 """frame: the lldb.SBFrame for the location at which you stopped
127 bp_loc: an lldb.SBBreakpointLocation for the breakpoint location information
128 internal_dict: an LLDB support object not to be used"""
129 print("Hit this breakpoint!")
130 DONE
131
132As a convenience, this also works for a short Python one-liner:
133
134(lldb) breakpoint command add -s python 1 -o 'import time; print(time.asctime())'
135(lldb) run
136Launching '.../a.out' (x86_64)
137(lldb) Fri Sep 10 12:17:45 2010
138Process 21778 Stopped
139* thread #1: tid = 0x2e03, 0x0000000100000de8 a.out`c + 7 at main.c:39, stop reason = breakpoint 1.1, queue = com.apple.main-thread
140 36
141 37 int c(int val)
142 38 {
143 39 -> return val + 3;
144 40 }
145 41
146 42 int main (int argc, char const *argv[])
147
148Example multiple line Python breakpoint command:
149
150(lldb) breakpoint command add -s p 1
151Enter your Python command(s). Type 'DONE' to end.
152def function (frame, bp_loc, internal_dict):
153 """frame: the lldb.SBFrame for the location at which you stopped
154 bp_loc: an lldb.SBBreakpointLocation for the breakpoint location information
155 internal_dict: an LLDB support object not to be used"""
156 global bp_count
157 bp_count = bp_count + 1
158 print("Hit this breakpoint " + repr(bp_count) + " times!")
159 DONE
160
161)"
162 "In this case, since there is a reference to a global variable, \
163'bp_count', you will also need to make sure 'bp_count' exists and is \
164initialized:"
165 R"(
166
167(lldb) script
168>>> bp_count = 0
169>>> quit()
170
171)"
172 "Your Python code, however organized, can optionally return a value. \
173If the returned value is False, that tells LLDB not to stop at the breakpoint \
174to which the code is associated. Returning anything other than False, or even \
175returning None, or even omitting a return statement entirely, will cause \
176LLDB to stop."
177 R"(
178
179)"
180 "Final Note: A warning that no breakpoint command was generated when there \
181are no syntax errors may indicate that a function was declared but never called.");
182
187
189 }
190
191 ~CommandObjectBreakpointCommandAdd() override = default;
192
193 Options *GetOptions() override { return &m_all_options; }
194
195 void IOHandlerActivated(IOHandler &io_handler, bool interactive) override {
196 StreamFileSP output_sp(io_handler.GetOutputStreamFileSP());
197 if (output_sp && interactive) {
198 output_sp->PutCString(g_reader_instructions);
199 output_sp->Flush();
200 }
201 }
202
203 void IOHandlerInputComplete(IOHandler &io_handler,
204 std::string &line) override {
205 io_handler.SetIsDone(true);
206
207 std::vector<std::reference_wrapper<BreakpointOptions>> *bp_options_vec =
208 (std::vector<std::reference_wrapper<BreakpointOptions>> *)
209 io_handler.GetUserData();
210 for (BreakpointOptions &bp_options : *bp_options_vec) {
211 auto cmd_data = std::make_unique<BreakpointOptions::CommandData>();
212 cmd_data->user_source.SplitIntoLines(line.c_str(), line.size());
213 bp_options.SetCommandDataCallback(cmd_data);
214 }
215 }
216
218 std::vector<std::reference_wrapper<BreakpointOptions>> &bp_options_vec,
219 CommandReturnObject &result) {
221 "> ", // Prompt
222 *this, // IOHandlerDelegate
223 &bp_options_vec); // Baton for the "io_handler" that will be passed back
224 // into our IOHandlerDelegate functions
227 /// Set a one-liner as the callback for the breakpoint.
229 std::vector<std::reference_wrapper<BreakpointOptions>> &bp_options_vec,
230 const char *oneliner) {
231 for (BreakpointOptions &bp_options : bp_options_vec) {
232 auto cmd_data = std::make_unique<BreakpointOptions::CommandData>();
233
234 cmd_data->user_source.AppendString(oneliner);
235 cmd_data->stop_on_error = m_options.m_stop_on_error;
237 bp_options.SetCommandDataCallback(cmd_data);
238 }
239 }
240
241 class CommandOptions : public OptionGroup {
242 public:
243 CommandOptions() = default;
244
245 ~CommandOptions() override = default;
246
247 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
248 ExecutionContext *execution_context) override {
250 const int short_option =
251 g_breakpoint_command_add_options[option_idx].short_option;
252
253 switch (short_option) {
254 case 'o':
255 m_use_one_liner = true;
256 m_one_liner = std::string(option_arg);
257 break;
258
259 case 's':
261 option_arg,
262 g_breakpoint_command_add_options[option_idx].enum_values,
264 switch (m_script_language) {
268 break;
271 m_use_script_language = false;
272 break;
273 }
274 break;
275
276 case 'e': {
277 bool success = false;
279 OptionArgParser::ToBoolean(option_arg, false, &success);
280 if (!success)
281 error.SetErrorStringWithFormat(
282 "invalid value for stop-on-error: \"%s\"",
283 option_arg.str().c_str());
284 } break;
285
286 case 'D':
287 m_use_dummy = true;
288 break;
289
290 default:
291 llvm_unreachable("Unimplemented option");
292 }
293 return error;
294 }
295
296 void OptionParsingStarting(ExecutionContext *execution_context) override {
297 m_use_commands = true;
298 m_use_script_language = false;
300
301 m_use_one_liner = false;
302 m_stop_on_error = true;
303 m_one_liner.clear();
304 m_use_dummy = false;
305 }
306
307 llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
308 return llvm::ArrayRef(g_breakpoint_command_add_options);
309 }
310
311 // Instance variables to hold the values for command options.
312
313 bool m_use_commands = false;
314 bool m_use_script_language = false;
316
317 // Instance variables to hold the values for one_liner options.
318 bool m_use_one_liner = false;
319 std::string m_one_liner;
320 bool m_stop_on_error;
321 bool m_use_dummy;
322 };
323
324protected:
325 void DoExecute(Args &command, CommandReturnObject &result) override {
327
328 const BreakpointList &breakpoints = target.GetBreakpointList();
329 size_t num_breakpoints = breakpoints.GetSize();
330
331 if (num_breakpoints == 0) {
332 result.AppendError("No breakpoints exist to have commands added");
333 return;
335
336 if (!m_func_options.GetName().empty()) {
341 }
342 }
343
344 BreakpointIDList valid_bp_ids;
346 command, &target, result, &valid_bp_ids,
347 BreakpointName::Permissions::PermissionKinds::listPerm);
348
349 m_bp_options_vec.clear();
350
351 if (result.Succeeded()) {
352 const size_t count = valid_bp_ids.GetSize();
353
354 for (size_t i = 0; i < count; ++i) {
355 BreakpointID cur_bp_id = valid_bp_ids.GetBreakpointIDAtIndex(i);
356 if (cur_bp_id.GetBreakpointID() != LLDB_INVALID_BREAK_ID) {
357 Breakpoint *bp =
358 target.GetBreakpointByID(cur_bp_id.GetBreakpointID()).get();
359 if (cur_bp_id.GetLocationID() == LLDB_INVALID_BREAK_ID) {
360 // This breakpoint does not have an associated location.
361 m_bp_options_vec.push_back(bp->GetOptions());
362 } else {
363 BreakpointLocationSP bp_loc_sp(
364 bp->FindLocationByID(cur_bp_id.GetLocationID()));
365 // This breakpoint does have an associated location. Get its
366 // breakpoint options.
367 if (bp_loc_sp)
368 m_bp_options_vec.push_back(bp_loc_sp->GetLocationOptions());
369 }
370 }
371 }
372
373 // If we are using script language, get the script interpreter in order
374 // to set or collect command callback. Otherwise, call the methods
375 // associated with this object.
379 /*can_create=*/true, m_options.m_script_language);
380 // Special handling for one-liner specified inline.
382 error = script_interp->SetBreakpointCommandCallback(
384 } else if (!m_func_options.GetName().empty()) {
388 } else {
390 m_bp_options_vec, result);
391 }
392 if (!error.Success())
393 result.SetError(error);
394 } else {
395 // Special handling for one-liner specified inline.
398 m_options.m_one_liner.c_str());
399 else
401 }
402 }
403 }
404
405private:
406 CommandOptions m_options;
409
410 std::vector<std::reference_wrapper<BreakpointOptions>>
411 m_bp_options_vec; // This stores the
412 // breakpoint options that
413 // we are currently
414 // collecting commands for. In the CollectData... calls we need to hand this
415 // off to the IOHandler, which may run asynchronously. So we have to have
416 // some way to keep it alive, and not leak it. Making it an ivar of the
417 // command object, which never goes away achieves this. Note that if we were
418 // able to run the same command concurrently in one interpreter we'd have to
419 // make this "per invocation". But there are many more reasons why it is not
420 // in general safe to do that in lldb at present, so it isn't worthwhile to
421 // come up with a more complex mechanism to address this particular weakness
422 // right now.
423 static const char *g_reader_instructions;
424};
425
427 "Enter your debugger command(s). Type 'DONE' to end.\n";
428
429// CommandObjectBreakpointCommandDelete
430
431#define LLDB_OPTIONS_breakpoint_command_delete
432#include "CommandOptions.inc"
433
435public:
437 : CommandObjectParsed(interpreter, "delete",
438 "Delete the set of commands from a breakpoint.",
439 nullptr) {
441 }
442
444
445 Options *GetOptions() override { return &m_options; }
446
447 class CommandOptions : public Options {
448 public:
449 CommandOptions() = default;
450
451 ~CommandOptions() override = default;
452
453 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
454 ExecutionContext *execution_context) override {
456 const int short_option = m_getopt_table[option_idx].val;
457
458 switch (short_option) {
459 case 'D':
460 m_use_dummy = true;
461 break;
462
463 default:
464 llvm_unreachable("Unimplemented option");
465 }
466
467 return error;
468 }
469
470 void OptionParsingStarting(ExecutionContext *execution_context) override {
471 m_use_dummy = false;
472 }
473
474 llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
475 return llvm::ArrayRef(g_breakpoint_command_delete_options);
476 }
477
478 // Instance variables to hold the values for command options.
479 bool m_use_dummy = false;
480 };
481
482protected:
483 void DoExecute(Args &command, CommandReturnObject &result) override {
485
486 const BreakpointList &breakpoints = target.GetBreakpointList();
487 size_t num_breakpoints = breakpoints.GetSize();
488
489 if (num_breakpoints == 0) {
490 result.AppendError("No breakpoints exist to have commands deleted");
491 return;
492 }
493
494 if (command.empty()) {
495 result.AppendError(
496 "No breakpoint specified from which to delete the commands");
497 return;
498 }
499
500 BreakpointIDList valid_bp_ids;
502 command, &target, result, &valid_bp_ids,
503 BreakpointName::Permissions::PermissionKinds::listPerm);
504
505 if (result.Succeeded()) {
506 const size_t count = valid_bp_ids.GetSize();
507 for (size_t i = 0; i < count; ++i) {
508 BreakpointID cur_bp_id = valid_bp_ids.GetBreakpointIDAtIndex(i);
509 if (cur_bp_id.GetBreakpointID() != LLDB_INVALID_BREAK_ID) {
510 Breakpoint *bp =
511 target.GetBreakpointByID(cur_bp_id.GetBreakpointID()).get();
512 if (cur_bp_id.GetLocationID() != LLDB_INVALID_BREAK_ID) {
513 BreakpointLocationSP bp_loc_sp(
514 bp->FindLocationByID(cur_bp_id.GetLocationID()));
515 if (bp_loc_sp)
516 bp_loc_sp->ClearCallback();
517 else {
518 result.AppendErrorWithFormat("Invalid breakpoint ID: %u.%u.\n",
519 cur_bp_id.GetBreakpointID(),
520 cur_bp_id.GetLocationID());
521 return;
522 }
523 } else {
524 bp->ClearCallback();
525 }
526 }
527 }
528 }
529 }
530
531private:
533};
534
535// CommandObjectBreakpointCommandList
536
538public:
540 : CommandObjectParsed(interpreter, "list",
541 "List the script or set of commands to be "
542 "executed when the breakpoint is hit.",
543 nullptr, eCommandRequiresTarget) {
545 }
546
548
549protected:
550 void DoExecute(Args &command, CommandReturnObject &result) override {
551 Target *target = &GetSelectedTarget();
552
553 const BreakpointList &breakpoints = target->GetBreakpointList();
554 size_t num_breakpoints = breakpoints.GetSize();
555
556 if (num_breakpoints == 0) {
557 result.AppendError("No breakpoints exist for which to list commands");
558 return;
559 }
560
561 if (command.empty()) {
562 result.AppendError(
563 "No breakpoint specified for which to list the commands");
564 return;
565 }
566
567 BreakpointIDList valid_bp_ids;
569 command, target, result, &valid_bp_ids,
570 BreakpointName::Permissions::PermissionKinds::listPerm);
571
572 if (result.Succeeded()) {
573 const size_t count = valid_bp_ids.GetSize();
574 for (size_t i = 0; i < count; ++i) {
575 BreakpointID cur_bp_id = valid_bp_ids.GetBreakpointIDAtIndex(i);
576 if (cur_bp_id.GetBreakpointID() != LLDB_INVALID_BREAK_ID) {
577 Breakpoint *bp =
578 target->GetBreakpointByID(cur_bp_id.GetBreakpointID()).get();
579
580 if (bp) {
581 BreakpointLocationSP bp_loc_sp;
582 if (cur_bp_id.GetLocationID() != LLDB_INVALID_BREAK_ID) {
583 bp_loc_sp = bp->FindLocationByID(cur_bp_id.GetLocationID());
584 if (!bp_loc_sp) {
585 result.AppendErrorWithFormat("Invalid breakpoint ID: %u.%u.\n",
586 cur_bp_id.GetBreakpointID(),
587 cur_bp_id.GetLocationID());
588 return;
589 }
590 }
591
592 StreamString id_str;
594 cur_bp_id.GetBreakpointID(),
595 cur_bp_id.GetLocationID());
596 const Baton *baton = nullptr;
597 if (bp_loc_sp)
598 baton =
599 bp_loc_sp
600 ->GetOptionsSpecifyingKind(BreakpointOptions::eCallback)
601 .GetBaton();
602 else
603 baton = bp->GetOptions().GetBaton();
604
605 if (baton) {
606 result.GetOutputStream().Printf("Breakpoint %s:\n",
607 id_str.GetData());
611 2);
612 } else {
614 "Breakpoint %s does not have an associated command.\n",
615 id_str.GetData());
616 }
617 }
619 } else {
620 result.AppendErrorWithFormat("Invalid breakpoint ID: %u.\n",
621 cur_bp_id.GetBreakpointID());
622 }
623 }
624 }
625 }
626};
627
628// CommandObjectBreakpointCommand
629
631 CommandInterpreter &interpreter)
633 interpreter, "command",
634 "Commands for adding, removing and listing "
635 "LLDB commands executed when a breakpoint is "
636 "hit.",
637 "command <sub-command> [<sub-command-options>] <breakpoint-id>") {
638 CommandObjectSP add_command_object(
639 new CommandObjectBreakpointCommandAdd(interpreter));
640 CommandObjectSP delete_command_object(
641 new CommandObjectBreakpointCommandDelete(interpreter));
642 CommandObjectSP list_command_object(
643 new CommandObjectBreakpointCommandList(interpreter));
644
645 add_command_object->SetCommandName("breakpoint command add");
646 delete_command_object->SetCommandName("breakpoint command delete");
647 list_command_object->SetCommandName("breakpoint command list");
648
649 LoadSubCommand("add", add_command_object);
650 LoadSubCommand("delete", delete_command_object);
651 LoadSubCommand("list", list_command_object);
652}
653
static llvm::raw_ostream & error(Stream &strm)
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
void OptionParsingStarting(ExecutionContext *execution_context) override
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
void CollectDataForBreakpointCommandCallback(std::vector< std::reference_wrapper< BreakpointOptions > > &bp_options_vec, CommandReturnObject &result)
CommandObjectBreakpointCommandAdd(CommandInterpreter &interpreter)
void SetBreakpointCommandCallback(std::vector< std::reference_wrapper< BreakpointOptions > > &bp_options_vec, const char *oneliner)
Set a one-liner as the callback for the breakpoint.
~CommandObjectBreakpointCommandAdd() override=default
void DoExecute(Args &command, CommandReturnObject &result) override
void IOHandlerInputComplete(IOHandler &io_handler, std::string &line) override
Called when a line or lines have been retrieved.
void IOHandlerActivated(IOHandler &io_handler, bool interactive) override
std::vector< std::reference_wrapper< BreakpointOptions > > m_bp_options_vec
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
void OptionParsingStarting(ExecutionContext *execution_context) override
~CommandObjectBreakpointCommandDelete() override=default
void DoExecute(Args &command, CommandReturnObject &result) override
CommandObjectBreakpointCommandDelete(CommandInterpreter &interpreter)
void DoExecute(Args &command, CommandReturnObject &result) override
~CommandObjectBreakpointCommandList() override=default
CommandObjectBreakpointCommandList(CommandInterpreter &interpreter)
A command line argument class.
Definition: Args.h:33
bool empty() const
Definition: Args.h:118
A class designed to wrap callback batons so they can cleanup any acquired resources.
Definition: Baton.h:35
virtual void GetDescription(llvm::raw_ostream &s, lldb::DescriptionLevel level, unsigned indentation) const =0
BreakpointID GetBreakpointIDAtIndex(size_t index) const
lldb::break_id_t GetBreakpointID() const
Definition: BreakpointID.h:33
lldb::break_id_t GetLocationID() const
Definition: BreakpointID.h:35
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...
General Outline: Allows adding and removing breakpoints and find by ID and index.
size_t GetSize() const
Returns the number of elements in this breakpoint list.
"lldb/Breakpoint/BreakpointOptions.h" Class that manages the options on a breakpoint or breakpoint lo...
Baton * GetBaton()
Fetch the baton from the callback.
General Outline: A breakpoint has four main parts, a filter, a resolver, the list of breakpoint locat...
Definition: Breakpoint.h:81
BreakpointOptions & GetOptions()
Returns the BreakpointOptions structure set at the breakpoint level.
Definition: Breakpoint.cpp:433
lldb::BreakpointLocationSP FindLocationByID(lldb::break_id_t bp_loc_id)
Find a breakpoint location for a given breakpoint location ID.
Definition: Breakpoint.cpp:265
void GetLLDBCommandsFromIOHandler(const char *prompt, IOHandlerDelegate &delegate, void *baton=nullptr)
static void VerifyBreakpointOrLocationIDs(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
virtual void SetHelpLong(llvm::StringRef str)
void AddSimpleArgumentList(lldb::CommandArgumentType arg_type, ArgumentRepetitionType repetition_type=eArgRepeatPlain)
CommandInterpreter & m_interpreter
Target & GetSelectedOrDummyTarget(bool prefer_dummy=false)
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 SetError(const Status &error, const char *fallback_error_cstr=nullptr)
lldb::ScriptLanguage GetScriptLanguage() const
Definition: Debugger.cpp:345
ScriptInterpreter * GetScriptInterpreter(bool can_create=true, std::optional< lldb::ScriptLanguage > language={})
Definition: Debugger.cpp:1684
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
A delegate class for use with IOHandler subclasses.
Definition: IOHandler.h:190
lldb::StreamFileSP GetOutputStreamFileSP()
Definition: IOHandler.cpp:105
void SetIsDone(bool b)
Definition: IOHandler.h:86
void Append(OptionGroup *group)
Append options from a OptionGroup class.
Definition: Options.cpp:755
const StructuredData::DictionarySP GetStructuredData()
A command line option parsing protocol class.
Definition: Options.h:58
std::vector< Option > m_getopt_table
Definition: Options.h:198
virtual void CollectDataForBreakpointCommandCallback(std::vector< std::reference_wrapper< BreakpointOptions > > &options, CommandReturnObject &result)
Status SetBreakpointCommandCallback(std::vector< std::reference_wrapper< BreakpointOptions > > &bp_options_vec, const char *callback_text)
Set the specified text as the callback for the breakpoint.
Status SetBreakpointCommandCallbackFunction(std::vector< std::reference_wrapper< BreakpointOptions > > &bp_options_vec, const char *function_name, StructuredData::ObjectSP extra_args_sp)
An error handling class.
Definition: Status.h:44
const char * GetData() const
Definition: StreamString.h:43
llvm::raw_ostream & AsRawOstream()
Returns a raw_ostream that forwards the data to this Stream object.
Definition: Stream.h:401
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:134
unsigned GetIndentLevel() const
Get the current indentation level.
Definition: Stream.cpp:187
lldb::BreakpointSP GetBreakpointByID(lldb::break_id_t break_id)
Definition: Target.cpp:328
BreakpointList & GetBreakpointList(bool internal=false)
Definition: Target.cpp:314
#define LLDB_OPT_SET_2
Definition: lldb-defines.h:112
#define LLDB_INVALID_BREAK_ID
Definition: lldb-defines.h:37
#define LLDB_OPT_SET_3
Definition: lldb-defines.h:113
A class that represents a running process on the host machine.
Definition: SBAddress.h:15
ScriptLanguage
Script interpreter types.
@ eScriptLanguageUnknown
@ eScriptLanguageLua
@ eScriptLanguageNone
@ eScriptLanguagePython
std::shared_ptr< lldb_private::BreakpointLocation > BreakpointLocationSP
Definition: lldb-forward.h:319
@ eDescriptionLevelFull
std::shared_ptr< lldb_private::CommandObject > CommandObjectSP
Definition: lldb-forward.h:328
@ eReturnStatusSuccessFinishResult
@ eArgTypeBreakpointID
std::shared_ptr< lldb_private::StreamFile > StreamFileSP
Definition: lldb-forward.h:424
static int64_t ToOptionEnum(llvm::StringRef s, const OptionEnumValues &enum_values, int32_t fail_value, Status &error)
static bool ToBoolean(llvm::StringRef s, bool fail_value, bool *success_ptr)