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
102
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"(
167(lldb) script
168>>> bp_count = 0
169>>> quit()
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 CommandArgumentData bp_id_arg;
190
191 // Define the first (and only) variant of this arg.
192 bp_id_arg.arg_type = eArgTypeBreakpointID;
194
195 // There is only one variant this argument could be; put it into the
196 // argument entry.
197 arg.push_back(bp_id_arg);
198
199 // Push the data for the first argument into the m_arguments vector.
200 m_arguments.push_back(arg);
201 }
202
203 ~CommandObjectBreakpointCommandAdd() override = default;
204
205 Options *GetOptions() override { return &m_all_options; }
206
207 void IOHandlerActivated(IOHandler &io_handler, bool interactive) override {
208 StreamFileSP output_sp(io_handler.GetOutputStreamFileSP());
209 if (output_sp && interactive) {
210 output_sp->PutCString(g_reader_instructions);
211 output_sp->Flush();
212 }
213 }
214
215 void IOHandlerInputComplete(IOHandler &io_handler,
216 std::string &line) override {
217 io_handler.SetIsDone(true);
218
219 std::vector<std::reference_wrapper<BreakpointOptions>> *bp_options_vec =
220 (std::vector<std::reference_wrapper<BreakpointOptions>> *)
221 io_handler.GetUserData();
222 for (BreakpointOptions &bp_options : *bp_options_vec) {
223 auto cmd_data = std::make_unique<BreakpointOptions::CommandData>();
224 cmd_data->user_source.SplitIntoLines(line.c_str(), line.size());
225 bp_options.SetCommandDataCallback(cmd_data);
226 }
227 }
228
230 std::vector<std::reference_wrapper<BreakpointOptions>> &bp_options_vec,
231 CommandReturnObject &result) {
233 "> ", // Prompt
234 *this, // IOHandlerDelegate
235 &bp_options_vec); // Baton for the "io_handler" that will be passed back
236 // into our IOHandlerDelegate functions
239 /// Set a one-liner as the callback for the breakpoint.
241 std::vector<std::reference_wrapper<BreakpointOptions>> &bp_options_vec,
242 const char *oneliner) {
243 for (BreakpointOptions &bp_options : bp_options_vec) {
244 auto cmd_data = std::make_unique<BreakpointOptions::CommandData>();
245
246 cmd_data->user_source.AppendString(oneliner);
247 cmd_data->stop_on_error = m_options.m_stop_on_error;
249 bp_options.SetCommandDataCallback(cmd_data);
250 }
251 }
252
253 class CommandOptions : public OptionGroup {
254 public:
255 CommandOptions() = default;
256
257 ~CommandOptions() override = default;
258
259 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
260 ExecutionContext *execution_context) override {
262 const int short_option =
263 g_breakpoint_command_add_options[option_idx].short_option;
264
265 switch (short_option) {
266 case 'o':
267 m_use_one_liner = true;
268 m_one_liner = std::string(option_arg);
269 break;
270
271 case 's':
273 option_arg,
274 g_breakpoint_command_add_options[option_idx].enum_values,
276 switch (m_script_language) {
280 break;
283 m_use_script_language = false;
284 break;
285 }
286 break;
287
288 case 'e': {
289 bool success = false;
291 OptionArgParser::ToBoolean(option_arg, false, &success);
292 if (!success)
293 error.SetErrorStringWithFormat(
294 "invalid value for stop-on-error: \"%s\"",
295 option_arg.str().c_str());
296 } break;
297
298 case 'D':
299 m_use_dummy = true;
300 break;
301
302 default:
303 llvm_unreachable("Unimplemented option");
304 }
305 return error;
306 }
307
308 void OptionParsingStarting(ExecutionContext *execution_context) override {
309 m_use_commands = true;
310 m_use_script_language = false;
312
313 m_use_one_liner = false;
314 m_stop_on_error = true;
315 m_one_liner.clear();
316 m_use_dummy = false;
317 }
318
319 llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
320 return llvm::ArrayRef(g_breakpoint_command_add_options);
321 }
322
323 // Instance variables to hold the values for command options.
324
325 bool m_use_commands = false;
326 bool m_use_script_language = false;
328
329 // Instance variables to hold the values for one_liner options.
330 bool m_use_one_liner = false;
331 std::string m_one_liner;
332 bool m_stop_on_error;
333 bool m_use_dummy;
334 };
335
336protected:
337 void DoExecute(Args &command, CommandReturnObject &result) override {
339
340 const BreakpointList &breakpoints = target.GetBreakpointList();
341 size_t num_breakpoints = breakpoints.GetSize();
342
343 if (num_breakpoints == 0) {
344 result.AppendError("No breakpoints exist to have commands added");
345 return;
347
348 if (!m_func_options.GetName().empty()) {
353 }
354 }
355
356 BreakpointIDList valid_bp_ids;
358 command, &target, result, &valid_bp_ids,
359 BreakpointName::Permissions::PermissionKinds::listPerm);
360
361 m_bp_options_vec.clear();
362
363 if (result.Succeeded()) {
364 const size_t count = valid_bp_ids.GetSize();
365
366 for (size_t i = 0; i < count; ++i) {
367 BreakpointID cur_bp_id = valid_bp_ids.GetBreakpointIDAtIndex(i);
368 if (cur_bp_id.GetBreakpointID() != LLDB_INVALID_BREAK_ID) {
369 Breakpoint *bp =
370 target.GetBreakpointByID(cur_bp_id.GetBreakpointID()).get();
371 if (cur_bp_id.GetLocationID() == LLDB_INVALID_BREAK_ID) {
372 // This breakpoint does not have an associated location.
373 m_bp_options_vec.push_back(bp->GetOptions());
374 } else {
375 BreakpointLocationSP bp_loc_sp(
376 bp->FindLocationByID(cur_bp_id.GetLocationID()));
377 // This breakpoint does have an associated location. Get its
378 // breakpoint options.
379 if (bp_loc_sp)
380 m_bp_options_vec.push_back(bp_loc_sp->GetLocationOptions());
381 }
382 }
383 }
384
385 // If we are using script language, get the script interpreter in order
386 // to set or collect command callback. Otherwise, call the methods
387 // associated with this object.
391 /*can_create=*/true, m_options.m_script_language);
392 // Special handling for one-liner specified inline.
394 error = script_interp->SetBreakpointCommandCallback(
396 } else if (!m_func_options.GetName().empty()) {
400 } else {
402 m_bp_options_vec, result);
403 }
404 if (!error.Success())
405 result.SetError(error);
406 } else {
407 // Special handling for one-liner specified inline.
410 m_options.m_one_liner.c_str());
411 else
413 }
414 }
415 }
416
417private:
418 CommandOptions m_options;
421
422 std::vector<std::reference_wrapper<BreakpointOptions>>
423 m_bp_options_vec; // This stores the
424 // breakpoint options that
425 // we are currently
426 // collecting commands for. In the CollectData... calls we need to hand this
427 // off to the IOHandler, which may run asynchronously. So we have to have
428 // some way to keep it alive, and not leak it. Making it an ivar of the
429 // command object, which never goes away achieves this. Note that if we were
430 // able to run the same command concurrently in one interpreter we'd have to
431 // make this "per invocation". But there are many more reasons why it is not
432 // in general safe to do that in lldb at present, so it isn't worthwhile to
433 // come up with a more complex mechanism to address this particular weakness
434 // right now.
435 static const char *g_reader_instructions;
436};
437
439 "Enter your debugger command(s). Type 'DONE' to end.\n";
440
441// CommandObjectBreakpointCommandDelete
442
443#define LLDB_OPTIONS_breakpoint_command_delete
444#include "CommandOptions.inc"
445
447public:
449 : CommandObjectParsed(interpreter, "delete",
450 "Delete the set of commands from a breakpoint.",
451 nullptr) {
453 CommandArgumentData bp_id_arg;
454
455 // Define the first (and only) variant of this arg.
456 bp_id_arg.arg_type = eArgTypeBreakpointID;
458
459 // There is only one variant this argument could be; put it into the
460 // argument entry.
461 arg.push_back(bp_id_arg);
462
463 // Push the data for the first argument into the m_arguments vector.
464 m_arguments.push_back(arg);
465 }
466
468
469 Options *GetOptions() override { return &m_options; }
470
471 class CommandOptions : public Options {
472 public:
473 CommandOptions() = default;
474
475 ~CommandOptions() override = default;
476
477 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
478 ExecutionContext *execution_context) override {
480 const int short_option = m_getopt_table[option_idx].val;
481
482 switch (short_option) {
483 case 'D':
484 m_use_dummy = true;
485 break;
486
487 default:
488 llvm_unreachable("Unimplemented option");
489 }
490
491 return error;
492 }
493
494 void OptionParsingStarting(ExecutionContext *execution_context) override {
495 m_use_dummy = false;
496 }
497
498 llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
499 return llvm::ArrayRef(g_breakpoint_command_delete_options);
500 }
501
502 // Instance variables to hold the values for command options.
503 bool m_use_dummy = false;
504 };
505
506protected:
507 void DoExecute(Args &command, CommandReturnObject &result) override {
509
510 const BreakpointList &breakpoints = target.GetBreakpointList();
511 size_t num_breakpoints = breakpoints.GetSize();
512
513 if (num_breakpoints == 0) {
514 result.AppendError("No breakpoints exist to have commands deleted");
515 return;
516 }
517
518 if (command.empty()) {
519 result.AppendError(
520 "No breakpoint specified from which to delete the commands");
521 return;
522 }
523
524 BreakpointIDList valid_bp_ids;
526 command, &target, result, &valid_bp_ids,
527 BreakpointName::Permissions::PermissionKinds::listPerm);
528
529 if (result.Succeeded()) {
530 const size_t count = valid_bp_ids.GetSize();
531 for (size_t i = 0; i < count; ++i) {
532 BreakpointID cur_bp_id = valid_bp_ids.GetBreakpointIDAtIndex(i);
533 if (cur_bp_id.GetBreakpointID() != LLDB_INVALID_BREAK_ID) {
534 Breakpoint *bp =
535 target.GetBreakpointByID(cur_bp_id.GetBreakpointID()).get();
536 if (cur_bp_id.GetLocationID() != LLDB_INVALID_BREAK_ID) {
537 BreakpointLocationSP bp_loc_sp(
538 bp->FindLocationByID(cur_bp_id.GetLocationID()));
539 if (bp_loc_sp)
540 bp_loc_sp->ClearCallback();
541 else {
542 result.AppendErrorWithFormat("Invalid breakpoint ID: %u.%u.\n",
543 cur_bp_id.GetBreakpointID(),
544 cur_bp_id.GetLocationID());
545 return;
546 }
547 } else {
548 bp->ClearCallback();
549 }
550 }
551 }
552 }
553 }
554
555private:
557};
558
559// CommandObjectBreakpointCommandList
560
562public:
564 : CommandObjectParsed(interpreter, "list",
565 "List the script or set of commands to be "
566 "executed when the breakpoint is hit.",
567 nullptr, eCommandRequiresTarget) {
569 CommandArgumentData bp_id_arg;
570
571 // Define the first (and only) variant of this arg.
572 bp_id_arg.arg_type = eArgTypeBreakpointID;
574
575 // There is only one variant this argument could be; put it into the
576 // argument entry.
577 arg.push_back(bp_id_arg);
578
579 // Push the data for the first argument into the m_arguments vector.
580 m_arguments.push_back(arg);
581 }
582
584
585protected:
586 void DoExecute(Args &command, CommandReturnObject &result) override {
587 Target *target = &GetSelectedTarget();
588
589 const BreakpointList &breakpoints = target->GetBreakpointList();
590 size_t num_breakpoints = breakpoints.GetSize();
591
592 if (num_breakpoints == 0) {
593 result.AppendError("No breakpoints exist for which to list commands");
594 return;
595 }
596
597 if (command.empty()) {
598 result.AppendError(
599 "No breakpoint specified for which to list the commands");
600 return;
601 }
602
603 BreakpointIDList valid_bp_ids;
605 command, target, result, &valid_bp_ids,
606 BreakpointName::Permissions::PermissionKinds::listPerm);
607
608 if (result.Succeeded()) {
609 const size_t count = valid_bp_ids.GetSize();
610 for (size_t i = 0; i < count; ++i) {
611 BreakpointID cur_bp_id = valid_bp_ids.GetBreakpointIDAtIndex(i);
612 if (cur_bp_id.GetBreakpointID() != LLDB_INVALID_BREAK_ID) {
613 Breakpoint *bp =
614 target->GetBreakpointByID(cur_bp_id.GetBreakpointID()).get();
615
616 if (bp) {
617 BreakpointLocationSP bp_loc_sp;
618 if (cur_bp_id.GetLocationID() != LLDB_INVALID_BREAK_ID) {
619 bp_loc_sp = bp->FindLocationByID(cur_bp_id.GetLocationID());
620 if (!bp_loc_sp) {
621 result.AppendErrorWithFormat("Invalid breakpoint ID: %u.%u.\n",
622 cur_bp_id.GetBreakpointID(),
623 cur_bp_id.GetLocationID());
624 return;
625 }
626 }
627
628 StreamString id_str;
630 cur_bp_id.GetBreakpointID(),
631 cur_bp_id.GetLocationID());
632 const Baton *baton = nullptr;
633 if (bp_loc_sp)
634 baton =
635 bp_loc_sp
636 ->GetOptionsSpecifyingKind(BreakpointOptions::eCallback)
637 .GetBaton();
638 else
639 baton = bp->GetOptions().GetBaton();
640
641 if (baton) {
642 result.GetOutputStream().Printf("Breakpoint %s:\n",
643 id_str.GetData());
647 2);
648 } else {
650 "Breakpoint %s does not have an associated command.\n",
651 id_str.GetData());
652 }
653 }
655 } else {
656 result.AppendErrorWithFormat("Invalid breakpoint ID: %u.\n",
657 cur_bp_id.GetBreakpointID());
658 }
659 }
660 }
661 }
662};
663
664// CommandObjectBreakpointCommand
665
667 CommandInterpreter &interpreter)
669 interpreter, "command",
670 "Commands for adding, removing and listing "
671 "LLDB commands executed when a breakpoint is "
672 "hit.",
673 "command <sub-command> [<sub-command-options>] <breakpoint-id>") {
674 CommandObjectSP add_command_object(
675 new CommandObjectBreakpointCommandAdd(interpreter));
676 CommandObjectSP delete_command_object(
677 new CommandObjectBreakpointCommandDelete(interpreter));
678 CommandObjectSP list_command_object(
679 new CommandObjectBreakpointCommandList(interpreter));
680
681 add_command_object->SetCommandName("breakpoint command add");
682 delete_command_object->SetCommandName("breakpoint command delete");
683 list_command_object->SetCommandName("breakpoint command list");
684
685 LoadSubCommand("add", add_command_object);
686 LoadSubCommand("delete", delete_command_object);
687 LoadSubCommand("list", list_command_object);
688}
689
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
std::vector< CommandArgumentData > CommandArgumentEntry
virtual void SetHelpLong(llvm::StringRef str)
std::vector< CommandArgumentEntry > m_arguments
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:344
ScriptInterpreter * GetScriptInterpreter(bool can_create=true, std::optional< lldb::ScriptLanguage > language={})
Definition: Debugger.cpp:1644
"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: SBAttachInfo.h:14
Definition: SBAddress.h:15
ScriptLanguage
Script interpreter types.
@ eScriptLanguageUnknown
@ eScriptLanguageLua
@ eScriptLanguageNone
@ eScriptLanguagePython
std::shared_ptr< lldb_private::BreakpointLocation > BreakpointLocationSP
Definition: lldb-forward.h:316
@ eDescriptionLevelFull
std::shared_ptr< lldb_private::CommandObject > CommandObjectSP
Definition: lldb-forward.h:325
@ eReturnStatusSuccessFinishResult
@ eArgTypeBreakpointID
std::shared_ptr< lldb_private::StreamFile > StreamFileSP
Definition: lldb-forward.h:421
Used to build individual command argument lists.
Definition: CommandObject.h:93
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)