1 //===-- CommandObjectBreakpointCommand.cpp ----------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "lldb/lldb-python.h"
16 #include "CommandObjectBreakpointCommand.h"
17 #include "CommandObjectBreakpoint.h"
19 #include "lldb/Core/IOHandler.h"
20 #include "lldb/Interpreter/CommandInterpreter.h"
21 #include "lldb/Interpreter/CommandReturnObject.h"
22 #include "lldb/Target/Target.h"
23 #include "lldb/Target/Thread.h"
24 #include "lldb/Breakpoint/BreakpointIDList.h"
25 #include "lldb/Breakpoint/Breakpoint.h"
26 #include "lldb/Breakpoint/BreakpointLocation.h"
27 #include "lldb/Breakpoint/StoppointCallbackContext.h"
28 #include "lldb/Core/State.h"
31 using namespace lldb_private;
33 //-------------------------------------------------------------------------
34 // CommandObjectBreakpointCommandAdd
35 //-------------------------------------------------------------------------
38 class CommandObjectBreakpointCommandAdd :
39 public CommandObjectParsed,
40 public IOHandlerDelegateMultiline
44 CommandObjectBreakpointCommandAdd (CommandInterpreter &interpreter) :
45 CommandObjectParsed (interpreter,
47 "Add a set of commands to a breakpoint, to be executed whenever the breakpoint is hit.",
49 IOHandlerDelegateMultiline ("DONE", IOHandlerDelegate::Completion::LLDBCommand),
50 m_options (interpreter)
53 "\nGeneral information about entering breakpoint commands\n\
54 ------------------------------------------------------\n\
56 This command will cause you to be prompted to enter the command or set of\n\
57 commands you wish to be executed when the specified breakpoint is hit. You\n\
58 will be told to enter your command(s), and will see a '> 'prompt. Because\n\
59 you can enter one or many commands to be executed when a breakpoint is hit,\n\
60 you will continue to be prompted after each new-line that you enter, until you\n\
61 enter the word 'DONE', which will cause the commands you have entered to be\n\
62 stored with the breakpoint and executed when the breakpoint is hit.\n\
64 Syntax checking is not necessarily done when breakpoint commands are entered.\n\
65 An improperly written breakpoint command will attempt to get executed when the\n\
66 breakpoint gets hit, and usually silently fail. If your breakpoint command does\n\
67 not appear to be getting executed, go back and check your syntax.\n\
69 Special information about PYTHON breakpoint commands\n\
70 ----------------------------------------------------\n\
72 You may enter either one line of Python, multiple lines of Python (including\n\
73 function definitions), or specify a Python function in a module that has already,\n\
74 or will be imported. If you enter a single line of Python, that will be passed\n\
75 to the Python interpreter 'as is' when the breakpoint gets hit. If you enter\n\
76 function definitions, they will be passed to the Python interpreter as soon as\n\
77 you finish entering the breakpoint command, and they can be called later (don't\n\
78 forget to add calls to them, if you want them called when the breakpoint is\n\
79 hit). If you enter multiple lines of Python that are not function definitions,\n\
80 they will be collected into a new, automatically generated Python function, and\n\
81 a call to the newly generated function will be attached to the breakpoint.\n\
84 This auto-generated function is passed in three arguments:\n\
86 frame: a lldb.SBFrame object for the frame which hit breakpoint.\n\
87 bp_loc: a lldb.SBBreakpointLocation object that represents the breakpoint\n\
88 location that was hit.\n\
89 dict: the python session dictionary hit.\n\
91 When specifying a python function with the --python-function option, you need\n\
92 to supply the function name prepended by the module name. So if you import a\n\
93 module named 'myutils' that contains a 'breakpoint_callback' function, you would\n\
94 specify the option as:\n\
96 --python-function myutils.breakpoint_callback\n\
98 The function itself must have the following prototype:\n\
100 def breakpoint_callback(frame, bp_loc, dict):\n\
101 # Your code goes here\n\
103 The arguments are the same as the 3 auto generation function arguments listed\n\
104 above. Note that the global variable 'lldb.frame' will NOT be setup when this\n\
105 function is called, so be sure to use the 'frame' argument. The 'frame' argument\n\
106 can get you to the thread (frame.GetThread()), the thread can get you to the\n\
107 process (thread.GetProcess()), and the process can get you back to the target\n\
108 (process.GetTarget()).\n\
110 Important Note: Because loose Python code gets collected into functions, if you\n\
111 want to access global variables in the 'loose' code, you need to specify that\n\
112 they are global, using the 'global' keyword. Be sure to use correct Python\n\
113 syntax, including indentation, when entering Python breakpoint commands.\n\
115 As a third option, you can pass the name of an already existing Python function\n\
116 and that function will be attached to the breakpoint. It will get passed the\n\
117 frame and bp_loc arguments mentioned above.\n\
119 Example Python one-line breakpoint command:\n\
121 (lldb) breakpoint command add -s python 1\n\
122 Enter your Python command(s). Type 'DONE' to end.\n\
123 > print \"Hit this breakpoint!\"\n\
126 As a convenience, this also works for a short Python one-liner:\n\
127 (lldb) breakpoint command add -s python 1 -o \"import time; print time.asctime()\"\n\
129 Launching '.../a.out' (x86_64)\n\
130 (lldb) Fri Sep 10 12:17:45 2010\n\
131 Process 21778 Stopped\n\
132 * thread #1: tid = 0x2e03, 0x0000000100000de8 a.out`c + 7 at main.c:39, stop reason = breakpoint 1.1, queue = com.apple.main-thread\n\
136 39 -> return val + 3;\n\
139 42 int main (int argc, char const *argv[])\n\
142 Example multiple line Python breakpoint command, using function definition:\n\
144 (lldb) breakpoint command add -s python 1\n\
145 Enter your Python command(s). Type 'DONE' to end.\n\
146 > def breakpoint_output (bp_no):\n\
147 > out_string = \"Hit breakpoint number \" + repr (bp_no)\n\
148 > print out_string\n\
150 > breakpoint_output (1)\n\
154 Example multiple line Python breakpoint command, using 'loose' Python:\n\
156 (lldb) breakpoint command add -s p 1\n\
157 Enter your Python command(s). Type 'DONE' to end.\n\
159 > bp_count = bp_count + 1\n\
160 > print \"Hit this breakpoint \" + repr(bp_count) + \" times!\"\n\
163 In this case, since there is a reference to a global variable,\n\
164 'bp_count', you will also need to make sure 'bp_count' exists and is\n\
174 Your Python code, however organized, can optionally return a value.\n\
175 If the returned value is False, that tells LLDB not to stop at the breakpoint\n\
176 to which the code is associated. Returning anything other than False, or even\n\
177 returning None, or even omitting a return statement entirely, will cause\n\
180 Final Note: If you get a warning that no breakpoint command was generated, but\n\
181 you did not get any syntax errors, you probably forgot to add a call to your\n\
184 Special information about debugger command breakpoint commands\n\
185 --------------------------------------------------------------\n\
187 You may enter any debugger command, exactly as you would at the debugger prompt.\n\
188 You may enter as many debugger commands as you like, but do NOT enter more than\n\
189 one command per line.\n" );
191 CommandArgumentEntry arg;
192 CommandArgumentData bp_id_arg;
194 // Define the first (and only) variant of this arg.
195 bp_id_arg.arg_type = eArgTypeBreakpointID;
196 bp_id_arg.arg_repetition = eArgRepeatPlain;
198 // There is only one variant this argument could be; put it into the argument entry.
199 arg.push_back (bp_id_arg);
201 // Push the data for the first argument into the m_arguments vector.
202 m_arguments.push_back (arg);
206 ~CommandObjectBreakpointCommandAdd () {}
215 IOHandlerActivated (IOHandler &io_handler)
217 StreamFileSP output_sp(io_handler.GetOutputStreamFile());
220 output_sp->PutCString(g_reader_instructions);
227 IOHandlerInputComplete (IOHandler &io_handler, std::string &line)
229 io_handler.SetIsDone(true);
231 BreakpointOptions *bp_options = (BreakpointOptions *) io_handler.GetUserData();
234 std::unique_ptr<BreakpointOptions::CommandData> data_ap(new BreakpointOptions::CommandData());
237 data_ap->user_source.SplitIntoLines (line.c_str(), line.size());
238 BatonSP baton_sp (new BreakpointOptions::CommandBaton (data_ap.release()));
239 bp_options->SetCallback (BreakpointOptionsCallbackFunction, baton_sp);
246 CollectDataForBreakpointCommandCallback (BreakpointOptions *bp_options,
247 CommandReturnObject &result)
249 m_interpreter.GetLLDBCommandsFromIOHandler ("> ", // Prompt
250 *this, // IOHandlerDelegate
251 true, // Run IOHandler in async mode
252 bp_options); // Baton for the "io_handler" that will be passed back into our IOHandlerDelegate functions
255 /// Set a one-liner as the callback for the breakpoint.
257 SetBreakpointCommandCallback (BreakpointOptions *bp_options,
258 const char *oneliner)
260 std::unique_ptr<BreakpointOptions::CommandData> data_ap(new BreakpointOptions::CommandData());
262 // It's necessary to set both user_source and script_source to the oneliner.
263 // The former is used to generate callback description (as in breakpoint command list)
264 // while the latter is used for Python to interpret during the actual callback.
265 data_ap->user_source.AppendString (oneliner);
266 data_ap->script_source.assign (oneliner);
267 data_ap->stop_on_error = m_options.m_stop_on_error;
269 BatonSP baton_sp (new BreakpointOptions::CommandBaton (data_ap.release()));
270 bp_options->SetCallback (BreakpointOptionsCallbackFunction, baton_sp);
276 BreakpointOptionsCallbackFunction (void *baton,
277 StoppointCallbackContext *context,
278 lldb::user_id_t break_id,
279 lldb::user_id_t break_loc_id)
281 bool ret_value = true;
286 BreakpointOptions::CommandData *data = (BreakpointOptions::CommandData *) baton;
287 StringList &commands = data->user_source;
289 if (commands.GetSize() > 0)
291 ExecutionContext exe_ctx (context->exe_ctx_ref);
292 Target *target = exe_ctx.GetTargetPtr();
295 CommandReturnObject result;
296 Debugger &debugger = target->GetDebugger();
297 // Rig up the results secondary output stream to the debugger's, so the output will come out synchronously
298 // if the debugger is set up that way.
300 StreamSP output_stream (debugger.GetAsyncOutputStream());
301 StreamSP error_stream (debugger.GetAsyncErrorStream());
302 result.SetImmediateOutputStream (output_stream);
303 result.SetImmediateErrorStream (error_stream);
305 bool stop_on_continue = true;
306 bool echo_commands = false;
307 bool print_results = true;
309 debugger.GetCommandInterpreter().HandleCommands (commands,
317 result.GetImmediateOutputStream()->Flush();
318 result.GetImmediateErrorStream()->Flush();
324 class CommandOptions : public Options
328 CommandOptions (CommandInterpreter &interpreter) :
329 Options (interpreter),
330 m_use_commands (false),
331 m_use_script_language (false),
332 m_script_language (eScriptLanguageNone),
333 m_use_one_liner (false),
340 ~CommandOptions () {}
343 SetOptionValue (uint32_t option_idx, const char *option_arg)
346 const int short_option = m_getopt_table[option_idx].val;
348 switch (short_option)
351 m_use_one_liner = true;
352 m_one_liner = option_arg;
356 m_script_language = (lldb::ScriptLanguage) Args::StringToOptionEnum (option_arg,
357 g_option_table[option_idx].enum_values,
361 if (m_script_language == eScriptLanguagePython || m_script_language == eScriptLanguageDefault)
363 m_use_script_language = true;
367 m_use_script_language = false;
373 bool success = false;
374 m_stop_on_error = Args::StringToBoolean(option_arg, false, &success);
376 error.SetErrorStringWithFormat("invalid value for stop-on-error: \"%s\"", option_arg);
382 m_use_one_liner = false;
383 m_use_script_language = true;
384 m_function_name.assign(option_arg);
394 OptionParsingStarting ()
396 m_use_commands = true;
397 m_use_script_language = false;
398 m_script_language = eScriptLanguageNone;
400 m_use_one_liner = false;
401 m_stop_on_error = true;
403 m_function_name.clear();
406 const OptionDefinition*
409 return g_option_table;
412 // Options table: Required for subclasses of Options.
414 static OptionDefinition g_option_table[];
416 // Instance variables to hold the values for command options.
419 bool m_use_script_language;
420 lldb::ScriptLanguage m_script_language;
422 // Instance variables to hold the values for one_liner options.
423 bool m_use_one_liner;
424 std::string m_one_liner;
425 bool m_stop_on_error;
426 std::string m_function_name;
431 DoExecute (Args& command, CommandReturnObject &result)
433 Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
437 result.AppendError ("There is not a current executable; there are no breakpoints to which to add commands");
438 result.SetStatus (eReturnStatusFailed);
442 const BreakpointList &breakpoints = target->GetBreakpointList();
443 size_t num_breakpoints = breakpoints.GetSize();
445 if (num_breakpoints == 0)
447 result.AppendError ("No breakpoints exist to have commands added");
448 result.SetStatus (eReturnStatusFailed);
452 if (m_options.m_use_script_language == false && m_options.m_function_name.size())
454 result.AppendError ("need to enable scripting to have a function run as a breakpoint command");
455 result.SetStatus (eReturnStatusFailed);
459 BreakpointIDList valid_bp_ids;
460 CommandObjectMultiwordBreakpoint::VerifyBreakpointIDs (command, target, result, &valid_bp_ids);
462 if (result.Succeeded())
464 const size_t count = valid_bp_ids.GetSize();
467 result.AppendError ("can only add commands to one breakpoint at a time.");
468 result.SetStatus (eReturnStatusFailed);
472 for (size_t i = 0; i < count; ++i)
474 BreakpointID cur_bp_id = valid_bp_ids.GetBreakpointIDAtIndex (i);
475 if (cur_bp_id.GetBreakpointID() != LLDB_INVALID_BREAK_ID)
477 Breakpoint *bp = target->GetBreakpointByID (cur_bp_id.GetBreakpointID()).get();
478 BreakpointOptions *bp_options = NULL;
479 if (cur_bp_id.GetLocationID() == LLDB_INVALID_BREAK_ID)
481 // This breakpoint does not have an associated location.
482 bp_options = bp->GetOptions();
486 BreakpointLocationSP bp_loc_sp(bp->FindLocationByID (cur_bp_id.GetLocationID()));
487 // This breakpoint does have an associated location.
488 // Get its breakpoint options.
490 bp_options = bp_loc_sp->GetLocationOptions();
493 // Skip this breakpoint if bp_options is not good.
494 if (bp_options == NULL) continue;
496 // If we are using script language, get the script interpreter
497 // in order to set or collect command callback. Otherwise, call
498 // the methods associated with this object.
499 if (m_options.m_use_script_language)
501 // Special handling for one-liner specified inline.
502 if (m_options.m_use_one_liner)
504 m_interpreter.GetScriptInterpreter()->SetBreakpointCommandCallback (bp_options,
505 m_options.m_one_liner.c_str());
507 // Special handling for using a Python function by name
508 // instead of extending the breakpoint callback data structures, we just automatize
509 // what the user would do manually: make their breakpoint command be a function call
510 else if (m_options.m_function_name.size())
512 std::string oneliner("return ");
513 oneliner += m_options.m_function_name;
514 oneliner += "(frame, bp_loc, internal_dict)";
515 m_interpreter.GetScriptInterpreter()->SetBreakpointCommandCallback (bp_options,
520 m_interpreter.GetScriptInterpreter()->CollectDataForBreakpointCommandCallback (bp_options,
526 // Special handling for one-liner specified inline.
527 if (m_options.m_use_one_liner)
528 SetBreakpointCommandCallback (bp_options,
529 m_options.m_one_liner.c_str());
531 CollectDataForBreakpointCommandCallback (bp_options,
538 return result.Succeeded();
542 CommandOptions m_options;
543 static const char *g_reader_instructions;
548 CommandObjectBreakpointCommandAdd::g_reader_instructions = "Enter your debugger command(s). Type 'DONE' to end.\n";
550 // FIXME: "script-type" needs to have its contents determined dynamically, so somebody can add a new scripting
551 // language to lldb and have it pickable here without having to change this enumeration by hand and rebuild lldb proper.
553 static OptionEnumValueElement
554 g_script_option_enumeration[4] =
556 { eScriptLanguageNone, "command", "Commands are in the lldb command interpreter language"},
557 { eScriptLanguagePython, "python", "Commands are in the Python language."},
558 { eSortOrderByName, "default-script", "Commands are in the default scripting language."},
563 CommandObjectBreakpointCommandAdd::CommandOptions::g_option_table[] =
565 { LLDB_OPT_SET_1, false, "one-liner", 'o', OptionParser::eRequiredArgument, NULL, 0, eArgTypeOneLiner,
566 "Specify a one-line breakpoint command inline. Be sure to surround it with quotes." },
568 { LLDB_OPT_SET_ALL, false, "stop-on-error", 'e', OptionParser::eRequiredArgument, NULL, 0, eArgTypeBoolean,
569 "Specify whether breakpoint command execution should terminate on error." },
571 { LLDB_OPT_SET_ALL, false, "script-type", 's', OptionParser::eRequiredArgument, g_script_option_enumeration, 0, eArgTypeNone,
572 "Specify the language for the commands - if none is specified, the lldb command interpreter will be used."},
574 { LLDB_OPT_SET_2, false, "python-function", 'F', OptionParser::eRequiredArgument, NULL, 0, eArgTypePythonFunction,
575 "Give the name of a Python function to run as command for this breakpoint. Be sure to give a module name if appropriate."},
577 { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL }
580 //-------------------------------------------------------------------------
581 // CommandObjectBreakpointCommandDelete
582 //-------------------------------------------------------------------------
584 class CommandObjectBreakpointCommandDelete : public CommandObjectParsed
587 CommandObjectBreakpointCommandDelete (CommandInterpreter &interpreter) :
588 CommandObjectParsed (interpreter,
590 "Delete the set of commands from a breakpoint.",
593 CommandArgumentEntry arg;
594 CommandArgumentData bp_id_arg;
596 // Define the first (and only) variant of this arg.
597 bp_id_arg.arg_type = eArgTypeBreakpointID;
598 bp_id_arg.arg_repetition = eArgRepeatPlain;
600 // There is only one variant this argument could be; put it into the argument entry.
601 arg.push_back (bp_id_arg);
603 // Push the data for the first argument into the m_arguments vector.
604 m_arguments.push_back (arg);
609 ~CommandObjectBreakpointCommandDelete () {}
613 DoExecute (Args& command, CommandReturnObject &result)
615 Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
619 result.AppendError ("There is not a current executable; there are no breakpoints from which to delete commands");
620 result.SetStatus (eReturnStatusFailed);
624 const BreakpointList &breakpoints = target->GetBreakpointList();
625 size_t num_breakpoints = breakpoints.GetSize();
627 if (num_breakpoints == 0)
629 result.AppendError ("No breakpoints exist to have commands deleted");
630 result.SetStatus (eReturnStatusFailed);
634 if (command.GetArgumentCount() == 0)
636 result.AppendError ("No breakpoint specified from which to delete the commands");
637 result.SetStatus (eReturnStatusFailed);
641 BreakpointIDList valid_bp_ids;
642 CommandObjectMultiwordBreakpoint::VerifyBreakpointIDs (command, target, result, &valid_bp_ids);
644 if (result.Succeeded())
646 const size_t count = valid_bp_ids.GetSize();
647 for (size_t i = 0; i < count; ++i)
649 BreakpointID cur_bp_id = valid_bp_ids.GetBreakpointIDAtIndex (i);
650 if (cur_bp_id.GetBreakpointID() != LLDB_INVALID_BREAK_ID)
652 Breakpoint *bp = target->GetBreakpointByID (cur_bp_id.GetBreakpointID()).get();
653 if (cur_bp_id.GetLocationID() != LLDB_INVALID_BREAK_ID)
655 BreakpointLocationSP bp_loc_sp (bp->FindLocationByID (cur_bp_id.GetLocationID()));
657 bp_loc_sp->ClearCallback();
660 result.AppendErrorWithFormat("Invalid breakpoint ID: %u.%u.\n",
661 cur_bp_id.GetBreakpointID(),
662 cur_bp_id.GetLocationID());
663 result.SetStatus (eReturnStatusFailed);
674 return result.Succeeded();
678 //-------------------------------------------------------------------------
679 // CommandObjectBreakpointCommandList
680 //-------------------------------------------------------------------------
682 class CommandObjectBreakpointCommandList : public CommandObjectParsed
685 CommandObjectBreakpointCommandList (CommandInterpreter &interpreter) :
686 CommandObjectParsed (interpreter,
688 "List the script or set of commands to be executed when the breakpoint is hit.",
691 CommandArgumentEntry arg;
692 CommandArgumentData bp_id_arg;
694 // Define the first (and only) variant of this arg.
695 bp_id_arg.arg_type = eArgTypeBreakpointID;
696 bp_id_arg.arg_repetition = eArgRepeatPlain;
698 // There is only one variant this argument could be; put it into the argument entry.
699 arg.push_back (bp_id_arg);
701 // Push the data for the first argument into the m_arguments vector.
702 m_arguments.push_back (arg);
706 ~CommandObjectBreakpointCommandList () {}
710 DoExecute (Args& command,
711 CommandReturnObject &result)
713 Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
717 result.AppendError ("There is not a current executable; there are no breakpoints for which to list commands");
718 result.SetStatus (eReturnStatusFailed);
722 const BreakpointList &breakpoints = target->GetBreakpointList();
723 size_t num_breakpoints = breakpoints.GetSize();
725 if (num_breakpoints == 0)
727 result.AppendError ("No breakpoints exist for which to list commands");
728 result.SetStatus (eReturnStatusFailed);
732 if (command.GetArgumentCount() == 0)
734 result.AppendError ("No breakpoint specified for which to list the commands");
735 result.SetStatus (eReturnStatusFailed);
739 BreakpointIDList valid_bp_ids;
740 CommandObjectMultiwordBreakpoint::VerifyBreakpointIDs (command, target, result, &valid_bp_ids);
742 if (result.Succeeded())
744 const size_t count = valid_bp_ids.GetSize();
745 for (size_t i = 0; i < count; ++i)
747 BreakpointID cur_bp_id = valid_bp_ids.GetBreakpointIDAtIndex (i);
748 if (cur_bp_id.GetBreakpointID() != LLDB_INVALID_BREAK_ID)
750 Breakpoint *bp = target->GetBreakpointByID (cur_bp_id.GetBreakpointID()).get();
754 const BreakpointOptions *bp_options = NULL;
755 if (cur_bp_id.GetLocationID() != LLDB_INVALID_BREAK_ID)
757 BreakpointLocationSP bp_loc_sp(bp->FindLocationByID (cur_bp_id.GetLocationID()));
759 bp_options = bp_loc_sp->GetOptionsNoCreate();
762 result.AppendErrorWithFormat("Invalid breakpoint ID: %u.%u.\n",
763 cur_bp_id.GetBreakpointID(),
764 cur_bp_id.GetLocationID());
765 result.SetStatus (eReturnStatusFailed);
771 bp_options = bp->GetOptions();
777 BreakpointID::GetCanonicalReference (&id_str,
778 cur_bp_id.GetBreakpointID(),
779 cur_bp_id.GetLocationID());
780 const Baton *baton = bp_options->GetBaton();
783 result.GetOutputStream().Printf ("Breakpoint %s:\n", id_str.GetData());
784 result.GetOutputStream().IndentMore ();
785 baton->GetDescription(&result.GetOutputStream(), eDescriptionLevelFull);
786 result.GetOutputStream().IndentLess ();
790 result.AppendMessageWithFormat ("Breakpoint %s does not have an associated command.\n",
794 result.SetStatus (eReturnStatusSuccessFinishResult);
798 result.AppendErrorWithFormat("Invalid breakpoint ID: %u.\n", cur_bp_id.GetBreakpointID());
799 result.SetStatus (eReturnStatusFailed);
806 return result.Succeeded();
810 //-------------------------------------------------------------------------
811 // CommandObjectBreakpointCommand
812 //-------------------------------------------------------------------------
814 CommandObjectBreakpointCommand::CommandObjectBreakpointCommand (CommandInterpreter &interpreter) :
815 CommandObjectMultiword (interpreter,
817 "A set of commands for adding, removing and examining bits of code to be executed when the breakpoint is hit (breakpoint 'commmands').",
818 "command <sub-command> [<sub-command-options>] <breakpoint-id>")
820 CommandObjectSP add_command_object (new CommandObjectBreakpointCommandAdd (interpreter));
821 CommandObjectSP delete_command_object (new CommandObjectBreakpointCommandDelete (interpreter));
822 CommandObjectSP list_command_object (new CommandObjectBreakpointCommandList (interpreter));
824 add_command_object->SetCommandName ("breakpoint command add");
825 delete_command_object->SetCommandName ("breakpoint command delete");
826 list_command_object->SetCommandName ("breakpoint command list");
828 LoadSubCommand ("add", add_command_object);
829 LoadSubCommand ("delete", delete_command_object);
830 LoadSubCommand ("list", list_command_object);
833 CommandObjectBreakpointCommand::~CommandObjectBreakpointCommand ()