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"(
114
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
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
183 m_all_options.Append(&m_options);
186 m_all_options.Finalize();
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 if (interactive) {
197 if (lldb::LockableStreamFileSP output_sp =
198 io_handler.GetOutputStreamFileSP()) {
199 LockedStreamFile locked_stream = output_sp->Lock();
200 locked_stream.PutCString(g_reader_instructions);
201 }
202 }
203 }
204
205 void IOHandlerInputComplete(IOHandler &io_handler,
206 std::string &line) override {
207 io_handler.SetIsDone(true);
209 std::vector<std::reference_wrapper<BreakpointOptions>> *bp_options_vec =
210 (std::vector<std::reference_wrapper<BreakpointOptions>> *)
211 io_handler.GetUserData();
212 for (BreakpointOptions &bp_options : *bp_options_vec) {
213 auto cmd_data = std::make_unique<BreakpointOptions::CommandData>();
214 cmd_data->user_source.SplitIntoLines(line.c_str(), line.size());
215 bp_options.SetCommandDataCallback(cmd_data);
216 }
217 }
218
220 std::vector<std::reference_wrapper<BreakpointOptions>> &bp_options_vec,
221 CommandReturnObject &result) {
222 m_interpreter.GetLLDBCommandsFromIOHandler(
223 "> ", // Prompt
224 *this, // IOHandlerDelegate
225 &bp_options_vec); // Baton for the "io_handler" that will be passed back
226 // into our IOHandlerDelegate functions
228
229 /// Set a one-liner as the callback for the breakpoint.
231 std::vector<std::reference_wrapper<BreakpointOptions>> &bp_options_vec,
232 const char *oneliner) {
233 for (BreakpointOptions &bp_options : bp_options_vec) {
234 auto cmd_data = std::make_unique<BreakpointOptions::CommandData>();
235
236 cmd_data->user_source.AppendString(oneliner);
237 cmd_data->stop_on_error = m_options.m_stop_on_error;
238
239 bp_options.SetCommandDataCallback(cmd_data);
240 }
241 }
242
243 class CommandOptions : public OptionGroup {
244 public:
245 CommandOptions() = default;
246
247 ~CommandOptions() override = default;
248
249 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
250 ExecutionContext *execution_context) override {
252 const int short_option =
253 g_breakpoint_command_add_options[option_idx].short_option;
254
255 switch (short_option) {
256 case 'o':
257 m_use_one_liner = true;
258 m_one_liner = std::string(option_arg);
259 break;
260
261 case 's':
263 option_arg,
264 g_breakpoint_command_add_options[option_idx].enum_values,
266 switch (m_script_language) {
270 break;
273 m_use_script_language = false;
274 break;
275 }
276 break;
277
278 case 'e': {
279 bool success = false;
281 OptionArgParser::ToBoolean(option_arg, false, &success);
282 if (!success)
283 return Status::FromErrorStringWithFormatv(
284 "invalid value for stop-on-error: \"{0}\"", option_arg);
285 } break;
286
287 case 'D':
288 m_use_dummy = true;
289 break;
290
291 default:
292 llvm_unreachable("Unimplemented option");
293 }
294 return error;
295 }
296
297 void OptionParsingStarting(ExecutionContext *execution_context) override {
298 m_use_commands = true;
299 m_use_script_language = false;
301
302 m_use_one_liner = false;
303 m_stop_on_error = true;
304 m_one_liner.clear();
305 m_use_dummy = false;
306 }
307
308 llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
309 return llvm::ArrayRef(g_breakpoint_command_add_options);
310 }
311
312 // Instance variables to hold the values for command options.
313
314 bool m_use_commands = false;
315 bool m_use_script_language = false;
317
318 // Instance variables to hold the values for one_liner options.
319 bool m_use_one_liner = false;
320 std::string m_one_liner;
321 bool m_stop_on_error;
322 bool m_use_dummy;
323 };
324
325protected:
326 void DoExecute(Args &command, CommandReturnObject &result) override {
327 Target &target = m_options.m_use_dummy ? GetDummyTarget() : GetTarget();
329 const BreakpointList &breakpoints = target.GetBreakpointList();
330 size_t num_breakpoints = breakpoints.GetSize();
331
332 if (num_breakpoints == 0) {
333 result.AppendError("No breakpoints exist to have commands added");
334 return;
335 }
336
337 if (!m_func_options.GetName().empty()) {
338 m_options.m_use_one_liner = false;
339 if (!m_options.m_use_script_language) {
340 m_options.m_script_language = GetDebugger().GetScriptLanguage();
341 m_options.m_use_script_language = true;
342 }
343 }
345 BreakpointIDList valid_bp_ids;
347 command, m_exe_ctx, result, &valid_bp_ids,
349
350 m_bp_options_vec.clear();
351
352 if (result.Succeeded()) {
353 const size_t count = valid_bp_ids.GetSize();
354
355 for (size_t i = 0; i < count; ++i) {
356 BreakpointID cur_bp_id = valid_bp_ids.GetBreakpointIDAtIndex(i);
357 if (cur_bp_id.GetBreakpointID() != LLDB_INVALID_BREAK_ID) {
358 Breakpoint *bp =
359 target.GetBreakpointByID(cur_bp_id.GetBreakpointID()).get();
360 if (cur_bp_id.GetLocationID() == LLDB_INVALID_BREAK_ID) {
361 // This breakpoint does not have an associated location.
362 m_bp_options_vec.push_back(bp->GetOptions());
363 } else {
364 BreakpointLocationSP bp_loc_sp(
365 bp->FindLocationByID(cur_bp_id.GetLocationID()));
366 // This breakpoint does have an associated location. Get its
367 // breakpoint options.
368 if (bp_loc_sp)
369 m_bp_options_vec.push_back(bp_loc_sp->GetLocationOptions());
370 }
371 }
372 }
373
374 // If we are using script language, get the script interpreter in order
375 // to set or collect command callback. Otherwise, call the methods
376 // associated with this object.
377 if (m_options.m_use_script_language) {
379 ScriptInterpreter *script_interp = GetDebugger().GetScriptInterpreter(
380 /*can_create=*/true, m_options.m_script_language);
381 // Special handling for one-liner specified inline.
382 if (m_options.m_use_one_liner) {
383 error = script_interp->SetBreakpointCommandCallback(
384 m_bp_options_vec, m_options.m_one_liner.c_str());
385 } else if (!m_func_options.GetName().empty()) {
387 m_bp_options_vec, m_func_options.GetName().c_str(),
388 m_func_options.GetStructuredData());
389 } else {
391 m_bp_options_vec, result);
392 // Still gathering input; the IOHandler will set the final status.
394 return;
395 }
396 if (!error.Success())
397 result.SetError(std::move(error));
398 else
400 } else {
401 // Special handling for one-liner specified inline.
402 if (m_options.m_use_one_liner) {
404 m_options.m_one_liner.c_str());
406 } else {
408 // Still gathering input; the IOHandler will set the final status.
410 }
411 }
412 }
413 }
414
415private:
416 CommandOptions m_options;
417 OptionGroupPythonClassWithDict m_func_options;
418 OptionGroupOptions m_all_options;
419
420 std::vector<std::reference_wrapper<BreakpointOptions>>
421 m_bp_options_vec; // This stores the
422 // breakpoint options that
423 // we are currently
424 // collecting commands for. In the CollectData... calls we need to hand this
425 // off to the IOHandler, which may run asynchronously. So we have to have
426 // some way to keep it alive, and not leak it. Making it an ivar of the
427 // command object, which never goes away achieves this. Note that if we were
428 // able to run the same command concurrently in one interpreter we'd have to
429 // make this "per invocation". But there are many more reasons why it is not
430 // in general safe to do that in lldb at present, so it isn't worthwhile to
431 // come up with a more complex mechanism to address this particular weakness
432 // right now.
433 static const char *g_reader_instructions;
434};
435
437 "Enter your debugger command(s). Type 'DONE' to end.\n";
438
439// CommandObjectBreakpointCommandDelete
440
441#define LLDB_OPTIONS_breakpoint_command_delete
442#include "CommandOptions.inc"
443
445public:
447 : CommandObjectParsed(interpreter, "delete",
448 "Delete the set of commands from a breakpoint.",
449 nullptr) {
451 }
452
454
455 Options *GetOptions() override { return &m_options; }
456
457 class CommandOptions : public Options {
458 public:
459 CommandOptions() = default;
460
461 ~CommandOptions() override = default;
462
463 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
464 ExecutionContext *execution_context) override {
466 const int short_option = m_getopt_table[option_idx].val;
467
468 switch (short_option) {
469 case 'D':
470 m_use_dummy = true;
471 break;
472
473 default:
474 llvm_unreachable("Unimplemented option");
475 }
476
477 return error;
478 }
479
480 void OptionParsingStarting(ExecutionContext *execution_context) override {
481 m_use_dummy = false;
482 }
483
484 llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
485 return llvm::ArrayRef(g_breakpoint_command_delete_options);
486 }
487
488 // Instance variables to hold the values for command options.
489 bool m_use_dummy = false;
490 };
491
492protected:
493 void DoExecute(Args &command, CommandReturnObject &result) override {
494 Target &target = m_options.m_use_dummy ? GetDummyTarget() : GetTarget();
495
496 const BreakpointList &breakpoints = target.GetBreakpointList();
497 size_t num_breakpoints = breakpoints.GetSize();
498
499 if (num_breakpoints == 0) {
500 result.AppendError("No breakpoints exist to have commands deleted");
501 return;
502 }
503
504 if (command.empty()) {
505 result.AppendError(
506 "No breakpoint specified from which to delete the commands");
507 return;
508 }
509
510 BreakpointIDList valid_bp_ids;
512 command, m_exe_ctx, result, &valid_bp_ids,
514
515 if (result.Succeeded()) {
516 const size_t count = valid_bp_ids.GetSize();
517 for (size_t i = 0; i < count; ++i) {
518 BreakpointID cur_bp_id = valid_bp_ids.GetBreakpointIDAtIndex(i);
519 if (cur_bp_id.GetBreakpointID() != LLDB_INVALID_BREAK_ID) {
520 Breakpoint *bp =
521 target.GetBreakpointByID(cur_bp_id.GetBreakpointID()).get();
522 if (cur_bp_id.GetLocationID() != LLDB_INVALID_BREAK_ID) {
523 BreakpointLocationSP bp_loc_sp(
524 bp->FindLocationByID(cur_bp_id.GetLocationID()));
525 if (bp_loc_sp)
526 bp_loc_sp->ClearCallback();
527 else {
528 result.AppendErrorWithFormat("Invalid breakpoint ID: %u.%u",
529 cur_bp_id.GetBreakpointID(),
530 cur_bp_id.GetLocationID());
531 return;
532 }
533 } else {
534 bp->ClearCallback();
535 }
536 }
537 }
538 }
539 }
540
541private:
543};
544
545// CommandObjectBreakpointCommandList
546
548public:
550 : CommandObjectParsed(interpreter, "list",
551 "List the script or set of commands to be "
552 "executed when the breakpoint is hit.",
553 nullptr, eCommandRequiresTarget) {
555 }
556
558
559protected:
560 void DoExecute(Args &command, CommandReturnObject &result) override {
561 Target &target = GetTarget();
562
563 const BreakpointList &breakpoints = target.GetBreakpointList();
564 size_t num_breakpoints = breakpoints.GetSize();
565
566 if (num_breakpoints == 0) {
567 result.AppendError("No breakpoints exist for which to list commands");
568 return;
569 }
570
571 if (command.empty()) {
572 result.AppendError(
573 "No breakpoint specified for which to list the commands");
574 return;
575 }
576
577 BreakpointIDList valid_bp_ids;
579 command, m_exe_ctx, result, &valid_bp_ids,
581
582 if (result.Succeeded()) {
583 const size_t count = valid_bp_ids.GetSize();
584 for (size_t i = 0; i < count; ++i) {
585 BreakpointID cur_bp_id = valid_bp_ids.GetBreakpointIDAtIndex(i);
586 if (cur_bp_id.GetBreakpointID() != LLDB_INVALID_BREAK_ID) {
587 Breakpoint *bp =
588 target.GetBreakpointByID(cur_bp_id.GetBreakpointID()).get();
589
590 if (bp) {
591 BreakpointLocationSP bp_loc_sp;
592 if (cur_bp_id.GetLocationID() != LLDB_INVALID_BREAK_ID) {
593 bp_loc_sp = bp->FindLocationByID(cur_bp_id.GetLocationID());
594 if (!bp_loc_sp) {
595 result.AppendErrorWithFormat("Invalid breakpoint ID: %u.%u",
596 cur_bp_id.GetBreakpointID(),
597 cur_bp_id.GetLocationID());
598 return;
599 }
600 }
601
602 StreamString id_str;
604 cur_bp_id.GetBreakpointID(),
605 cur_bp_id.GetLocationID());
606 const Baton *baton = nullptr;
607 if (bp_loc_sp)
608 baton =
609 bp_loc_sp
610 ->GetOptionsSpecifyingKind(BreakpointOptions::eCallback)
611 .GetBaton();
612 else
613 baton = bp->GetOptions().GetBaton();
614
615 if (baton) {
616 result.GetOutputStream().Printf("Breakpoint %s:\n",
617 id_str.GetData());
621 2);
622 } else {
624 "Breakpoint {0} does not have an associated command.",
625 id_str.GetData());
626 }
627 }
629 } else {
630 result.AppendErrorWithFormat("Invalid breakpoint ID: %u",
631 cur_bp_id.GetBreakpointID());
632 }
633 }
634 }
635 }
636};
637
638// CommandObjectBreakpointCommand
639
641 CommandInterpreter &interpreter)
643 interpreter, "command",
644 "Commands for adding, removing and listing "
645 "LLDB commands executed when a breakpoint is "
646 "hit.",
647 "command <sub-command> [<sub-command-options>] <breakpoint-id>") {
648 CommandObjectSP add_command_object(
649 new CommandObjectBreakpointCommandAdd(interpreter));
650 CommandObjectSP delete_command_object(
651 new CommandObjectBreakpointCommandDelete(interpreter));
652 CommandObjectSP list_command_object(
653 new CommandObjectBreakpointCommandList(interpreter));
654
655 add_command_object->SetCommandName("breakpoint command add");
656 delete_command_object->SetCommandName("breakpoint command delete");
657 list_command_object->SetCommandName("breakpoint command list");
658
659 LoadSubCommand("add", add_command_object);
660 LoadSubCommand("delete", delete_command_object);
661 LoadSubCommand("list", list_command_object);
662}
663
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:122
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
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...
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
lldb::BreakpointLocationSP FindLocationByID(lldb::break_id_t bp_loc_id, bool use_facade=true)
Find a breakpoint location for a given breakpoint location ID.
BreakpointOptions & GetOptions()
Returns the BreakpointOptions structure set at the breakpoint level.
static void VerifyBreakpointOrLocationIDs(Args &args, ExecutionContext &exe_ctx, CommandReturnObject &result, BreakpointIDList *valid_ids, BreakpointName::Permissions ::PermissionKinds purpose)
bool LoadSubCommand(llvm::StringRef cmd_name, const lldb::CommandObjectSP &command_obj) override
CommandObjectMultiword(CommandInterpreter &interpreter, const char *name, const char *help=nullptr, const char *syntax=nullptr, uint32_t flags=0)
CommandObjectParsed(CommandInterpreter &interpreter, const char *name, const char *help=nullptr, const char *syntax=nullptr, uint32_t flags=0)
virtual void SetHelpLong(llvm::StringRef str)
void AddSimpleArgumentList(lldb::CommandArgumentType arg_type, ArgumentRepetitionType repetition_type=eArgRepeatPlain)
CommandInterpreter & m_interpreter
void AppendError(llvm::StringRef in_string)
void SetStatus(lldb::ReturnStatus status)
void AppendErrorWithFormat(const char *format,...) __attribute__((format(printf
void void AppendMessageWithFormatv(const char *format, Args &&...args)
ScriptInterpreter * GetScriptInterpreter(bool can_create=true, std::optional< lldb::ScriptLanguage > language={})
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
IOHandlerDelegateMultiline(llvm::StringRef end_line, Completion completion=Completion::None)
Definition IOHandler.h:289
A delegate class for use with IOHandler subclasses.
Definition IOHandler.h:184
lldb::LockableStreamFileSP GetOutputStreamFileSP()
Definition IOHandler.cpp:93
void SetIsDone(bool b)
Definition IOHandler.h:81
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:118
const char * GetData() const
llvm::raw_ostream & AsRawOstream()
Returns a raw_ostream that forwards the data to this Stream object.
Definition Stream.h:405
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition Stream.cpp:134
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition Stream.cpp:63
unsigned GetIndentLevel() const
Get the current indentation level.
Definition Stream.cpp:193
lldb::BreakpointSP GetBreakpointByID(lldb::break_id_t break_id)
Definition Target.cpp:436
BreakpointList & GetBreakpointList(bool internal=false)
Definition Target.cpp:422
#define LLDB_OPT_SET_2
#define LLDB_INVALID_BREAK_ID
#define LLDB_OPT_SET_3
A class that represents a running process on the host machine.
ScriptLanguage
Script interpreter types.
@ eScriptLanguageUnknown
@ eScriptLanguageNone
@ eScriptLanguagePython
std::shared_ptr< lldb_private::BreakpointLocation > BreakpointLocationSP
@ eDescriptionLevelFull
std::shared_ptr< lldb_private::CommandObject > CommandObjectSP
@ eReturnStatusStarted
@ eReturnStatusSuccessFinishResult
@ eReturnStatusSuccessFinishNoResult
@ eArgTypeBreakpointID
std::shared_ptr< lldb_private::LockableStreamFile > LockableStreamFileSP
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)