[lldb][NFC] Fix all formatting errors in .cpp file headers
Summary:
A *.cpp file header in LLDB (and in LLDB) should like this:
```
//===-- TestUtilities.cpp -------------------------------------------------===//
```
However in LLDB most of our source files have arbitrary changes to this format and
these changes are spreading through LLDB as folks usually just use the existing
source files as templates for their new files (most notably the unnecessary
editor language indicator `-*- C++ -*-` is spreading and in every review
someone is pointing out that this is wrong, resulting in people pointing out that this
is done in the same way in other files).
This patch removes most of these inconsistencies including the editor language indicators,
all the different missing/additional '-' characters, files that center the file name, missing
trailing `===//` (mostly caused by clang-format breaking the line).
Reviewers: aprantl, espindola, jfb, shafik, JDevlieghere
Reviewed By: JDevlieghere
Subscribers: dexonsmith, wuzish, emaste, sdardis, nemanjai, kbarton, MaskRay, atanasyan, arphaman, jfb, abidh, jsji, JDevlieghere, usaxena95, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D73258
2020-01-24 08:23:27 +01:00
|
|
|
//===-- CommandObjectWatchpointCommand.cpp --------------------------------===//
|
2012-08-09 23:09:42 +00:00
|
|
|
//
|
2019-01-19 08:50:56 +00:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2012-08-09 23:09:42 +00:00
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
2016-02-23 01:43:44 +00:00
|
|
|
#include <vector>
|
2012-08-09 23:09:42 +00:00
|
|
|
|
|
|
|
|
#include "CommandObjectWatchpoint.h"
|
|
|
|
|
#include "CommandObjectWatchpointCommand.h"
|
|
|
|
|
#include "lldb/Breakpoint/StoppointCallbackContext.h"
|
|
|
|
|
#include "lldb/Breakpoint/Watchpoint.h"
|
2014-01-27 23:43:24 +00:00
|
|
|
#include "lldb/Core/IOHandler.h"
|
2017-03-22 23:33:16 +00:00
|
|
|
#include "lldb/Host/OptionParser.h"
|
2025-02-19 20:32:00 -08:00
|
|
|
#include "lldb/Host/StreamFile.h"
|
2012-08-09 23:09:42 +00:00
|
|
|
#include "lldb/Interpreter/CommandInterpreter.h"
|
2022-07-13 20:11:37 -07:00
|
|
|
#include "lldb/Interpreter/CommandOptionArgumentTable.h"
|
2012-08-09 23:09:42 +00:00
|
|
|
#include "lldb/Interpreter/CommandReturnObject.h"
|
2018-04-10 09:03:59 +00:00
|
|
|
#include "lldb/Interpreter/OptionArgParser.h"
|
2012-08-09 23:09:42 +00:00
|
|
|
#include "lldb/Target/Target.h"
|
2025-02-19 20:32:00 -08:00
|
|
|
#include "lldb/lldb-forward.h"
|
2012-08-09 23:09:42 +00:00
|
|
|
|
|
|
|
|
using namespace lldb;
|
|
|
|
|
using namespace lldb_private;
|
|
|
|
|
|
2019-07-17 11:48:29 +00:00
|
|
|
#define LLDB_OPTIONS_watchpoint_command_add
|
|
|
|
|
#include "CommandOptions.inc"
|
Convert option tables to ArrayRefs.
This change is very mechanical. All it does is change the
signature of `Options::GetDefinitions()` and `OptionGroup::
GetDefinitions()` to return an `ArrayRef<OptionDefinition>`
instead of a `const OptionDefinition *`. In the case of the
former, it deletes the sentinel entry from every table, and
in the case of the latter, it removes the `GetNumDefinitions()`
method from the interface. These are no longer necessary as
`ArrayRef` carries its own length.
In the former case, iteration was done by using a sentinel
entry, so there was no knowledge of length. Because of this
the individual option tables were allowed to be defined below
the corresponding class (after all, only a pointer was needed).
Now, however, the length must be known at compile time to
construct the `ArrayRef`, and as a result it is necessary to
move every option table before its corresponding class. This
results in this CL looking very big, but in terms of substance
there is not much here.
Differential revision: https://reviews.llvm.org/D24834
llvm-svn: 282188
2016-09-22 20:22:55 +00:00
|
|
|
|
2014-01-27 23:43:24 +00:00
|
|
|
class CommandObjectWatchpointCommandAdd : public CommandObjectParsed,
|
|
|
|
|
public IOHandlerDelegateMultiline {
|
2012-08-09 23:09:42 +00:00
|
|
|
public:
|
2016-07-14 22:03:10 +00:00
|
|
|
CommandObjectWatchpointCommandAdd(CommandInterpreter &interpreter)
|
|
|
|
|
: CommandObjectParsed(interpreter, "add",
|
|
|
|
|
"Add a set of LLDB commands to a watchpoint, to be "
|
2021-05-03 17:17:51 -07:00
|
|
|
"executed whenever the watchpoint is hit. "
|
|
|
|
|
"The commands added to the watchpoint replace any "
|
|
|
|
|
"commands previously added to it.",
|
2019-08-31 09:41:25 +00:00
|
|
|
nullptr, eCommandRequiresTarget),
|
2016-07-14 22:03:10 +00:00
|
|
|
IOHandlerDelegateMultiline("DONE",
|
2022-01-23 11:07:14 -08:00
|
|
|
IOHandlerDelegate::Completion::LLDBCommand) {
|
2012-08-09 23:09:42 +00:00
|
|
|
SetHelpLong(
|
2015-07-14 05:48:36 +00:00
|
|
|
R"(
|
|
|
|
|
General information about entering watchpoint commands
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
)"
|
|
|
|
|
"This command will prompt for commands to be executed when the specified \
|
|
|
|
|
watchpoint is hit. Each command is typed on its own line following the '> ' \
|
|
|
|
|
prompt until 'DONE' is entered."
|
|
|
|
|
R"(
|
|
|
|
|
|
|
|
|
|
)"
|
|
|
|
|
"Syntactic errors may not be detected when initially entered, and many \
|
|
|
|
|
malformed commands can silently fail when executed. If your watchpoint commands \
|
|
|
|
|
do not appear to be executing, double-check the command syntax."
|
|
|
|
|
R"(
|
|
|
|
|
|
|
|
|
|
)"
|
|
|
|
|
"Note: You may enter any debugger command exactly as you would at the debugger \
|
|
|
|
|
prompt. There is no limit to the number of commands supplied, but do NOT enter \
|
|
|
|
|
more than one command per line."
|
|
|
|
|
R"(
|
|
|
|
|
|
|
|
|
|
Special information about PYTHON watchpoint commands
|
|
|
|
|
----------------------------------------------------
|
|
|
|
|
|
|
|
|
|
)"
|
|
|
|
|
"You may enter either one or more lines of Python, including function \
|
|
|
|
|
definitions or calls to functions that will have been imported by the time \
|
|
|
|
|
the code executes. Single line watchpoint commands will be interpreted 'as is' \
|
|
|
|
|
when the watchpoint is hit. Multiple lines of Python will be wrapped in a \
|
|
|
|
|
generated function, and a call to the function will be attached to the watchpoint."
|
|
|
|
|
R"(
|
|
|
|
|
|
|
|
|
|
This auto-generated function is passed in three arguments:
|
|
|
|
|
|
|
|
|
|
frame: an lldb.SBFrame object for the frame which hit the watchpoint.
|
|
|
|
|
|
|
|
|
|
wp: the watchpoint that was hit.
|
|
|
|
|
|
|
|
|
|
)"
|
|
|
|
|
"When specifying a python function with the --python-function option, you need \
|
|
|
|
|
to supply the function name prepended by the module name:"
|
|
|
|
|
R"(
|
|
|
|
|
|
|
|
|
|
--python-function myutils.watchpoint_callback
|
|
|
|
|
|
|
|
|
|
The function itself must have the following prototype:
|
|
|
|
|
|
|
|
|
|
def watchpoint_callback(frame, wp):
|
|
|
|
|
# Your code goes here
|
|
|
|
|
|
|
|
|
|
)"
|
|
|
|
|
"The arguments are the same as the arguments passed to generated functions as \
|
|
|
|
|
described above. Note that the global variable 'lldb.frame' will NOT be updated when \
|
|
|
|
|
this function is called, so be sure to use the 'frame' argument. The 'frame' argument \
|
|
|
|
|
can get you to the thread via frame.GetThread(), the thread can get you to the \
|
|
|
|
|
process via thread.GetProcess(), and the process can get you back to the target \
|
|
|
|
|
via process.GetTarget()."
|
|
|
|
|
R"(
|
|
|
|
|
|
|
|
|
|
)"
|
|
|
|
|
"Important Note: As Python code gets collected into functions, access to global \
|
|
|
|
|
variables requires explicit scoping using the 'global' keyword. Be sure to use correct \
|
|
|
|
|
Python syntax, including indentation, when entering Python watchpoint commands."
|
|
|
|
|
R"(
|
|
|
|
|
|
|
|
|
|
Example Python one-line watchpoint command:
|
|
|
|
|
|
|
|
|
|
(lldb) watchpoint command add -s python 1
|
|
|
|
|
Enter your Python command(s). Type 'DONE' to end.
|
|
|
|
|
> print "Hit this watchpoint!"
|
|
|
|
|
> DONE
|
|
|
|
|
|
|
|
|
|
As a convenience, this also works for a short Python one-liner:
|
|
|
|
|
|
|
|
|
|
(lldb) watchpoint command add -s python 1 -o 'import time; print time.asctime()'
|
|
|
|
|
(lldb) run
|
|
|
|
|
Launching '.../a.out' (x86_64)
|
|
|
|
|
(lldb) Fri Sep 10 12:17:45 2010
|
|
|
|
|
Process 21778 Stopped
|
|
|
|
|
* thread #1: tid = 0x2e03, 0x0000000100000de8 a.out`c + 7 at main.c:39, stop reason = watchpoint 1.1, queue = com.apple.main-thread
|
|
|
|
|
36
|
|
|
|
|
37 int c(int val)
|
|
|
|
|
38 {
|
|
|
|
|
39 -> return val + 3;
|
|
|
|
|
40 }
|
|
|
|
|
41
|
|
|
|
|
42 int main (int argc, char const *argv[])
|
|
|
|
|
|
|
|
|
|
Example multiple line Python watchpoint command, using function definition:
|
|
|
|
|
|
|
|
|
|
(lldb) watchpoint command add -s python 1
|
|
|
|
|
Enter your Python command(s). Type 'DONE' to end.
|
|
|
|
|
> def watchpoint_output (wp_no):
|
|
|
|
|
> out_string = "Hit watchpoint number " + repr (wp_no)
|
|
|
|
|
> print out_string
|
|
|
|
|
> return True
|
|
|
|
|
> watchpoint_output (1)
|
|
|
|
|
> DONE
|
|
|
|
|
|
|
|
|
|
Example multiple line Python watchpoint command, using 'loose' Python:
|
|
|
|
|
|
|
|
|
|
(lldb) watchpoint command add -s p 1
|
|
|
|
|
Enter your Python command(s). Type 'DONE' to end.
|
|
|
|
|
> global wp_count
|
|
|
|
|
> wp_count = wp_count + 1
|
|
|
|
|
> print "Hit this watchpoint " + repr(wp_count) + " times!"
|
|
|
|
|
> DONE
|
|
|
|
|
|
|
|
|
|
)"
|
|
|
|
|
"In this case, since there is a reference to a global variable, \
|
|
|
|
|
'wp_count', you will also need to make sure 'wp_count' exists and is \
|
|
|
|
|
initialized:"
|
|
|
|
|
R"(
|
|
|
|
|
|
|
|
|
|
(lldb) script
|
|
|
|
|
>>> wp_count = 0
|
|
|
|
|
>>> quit()
|
|
|
|
|
|
|
|
|
|
)"
|
|
|
|
|
"Final Note: A warning that no watchpoint command was generated when there \
|
|
|
|
|
are no syntax errors may indicate that a function was declared but never called.");
|
2012-08-09 23:09:42 +00:00
|
|
|
|
2024-02-27 10:34:01 -08:00
|
|
|
AddSimpleArgumentList(eArgTypeWatchpointID);
|
2012-08-09 23:09:42 +00:00
|
|
|
}
|
|
|
|
|
|
2016-02-23 01:43:44 +00:00
|
|
|
~CommandObjectWatchpointCommandAdd() override = default;
|
2012-08-09 23:09:42 +00:00
|
|
|
|
2015-10-07 16:56:17 +00:00
|
|
|
Options *GetOptions() override { return &m_options; }
|
2012-08-09 23:09:42 +00:00
|
|
|
|
Quiet command regex instructions during batch execution
Summary:
Within .lldbinit, regex commands can be structured as a list of substitutions over
multiple lines. It's possible that this is uninentional, but it works and has
benefits.
For example:
command regex <command-name>
s/pat1/repl1/
s/pat2/repl2/
...
I use this form of `command regex` in my `~/.lldbinit`, because it makes it
clearer to write and read compared to a single line definition, because
multiline substitutions don't need to be quoted, and are broken up one per line.
However, multiline definitions result in usage instructions being printed for
each use. The result is that every time I run `lldb`, I get a dozen or more
lines of noise. With this change, the instructions are only printed when
`command regex` is invoked interactively, or from a terminal, neither of which
are true when lldb is sourcing `~/.lldbinit`.
Reviewers: clayborg, jingham
Reviewed By: clayborg
Subscribers: jdoerfert, kastiglione, xiaobai, keith, lldb-commits
Differential Revision: https://reviews.llvm.org/D48752
llvm-svn: 355793
2019-03-10 23:15:48 +00:00
|
|
|
void IOHandlerActivated(IOHandler &io_handler, bool interactive) override {
|
2025-02-19 20:32:00 -08:00
|
|
|
if (interactive) {
|
|
|
|
|
if (lldb::LockableStreamFileSP output_sp =
|
|
|
|
|
io_handler.GetOutputStreamFileSP()) {
|
|
|
|
|
LockedStreamFile locked_stream = output_sp->Lock();
|
|
|
|
|
locked_stream.PutCString(
|
|
|
|
|
"Enter your debugger command(s). Type 'DONE' to end.\n");
|
|
|
|
|
}
|
2014-01-27 23:43:24 +00:00
|
|
|
}
|
2016-09-06 20:57:50 +00:00
|
|
|
}
|
|
|
|
|
|
2015-10-07 16:56:17 +00:00
|
|
|
void IOHandlerInputComplete(IOHandler &io_handler,
|
|
|
|
|
std::string &line) override {
|
2014-01-27 23:43:24 +00:00
|
|
|
io_handler.SetIsDone(true);
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2014-01-27 23:43:24 +00:00
|
|
|
// The WatchpointOptions object is owned by the watchpoint or watchpoint
|
|
|
|
|
// location
|
|
|
|
|
WatchpointOptions *wp_options =
|
|
|
|
|
(WatchpointOptions *)io_handler.GetUserData();
|
|
|
|
|
if (wp_options) {
|
2019-02-13 06:25:41 +00:00
|
|
|
std::unique_ptr<WatchpointOptions::CommandData> data_up(
|
2014-01-27 23:43:24 +00:00
|
|
|
new WatchpointOptions::CommandData());
|
2019-02-13 06:25:41 +00:00
|
|
|
if (data_up) {
|
|
|
|
|
data_up->user_source.SplitIntoLines(line);
|
2016-09-13 17:53:38 +00:00
|
|
|
auto baton_sp = std::make_shared<WatchpointOptions::CommandBaton>(
|
2019-02-13 06:25:41 +00:00
|
|
|
std::move(data_up));
|
2014-01-27 23:43:24 +00:00
|
|
|
wp_options->SetCallback(WatchpointOptionsCallbackFunction, baton_sp);
|
2012-08-09 23:09:42 +00:00
|
|
|
}
|
2014-01-27 23:43:24 +00:00
|
|
|
}
|
2016-09-06 20:57:50 +00:00
|
|
|
}
|
|
|
|
|
|
2014-01-27 23:43:24 +00:00
|
|
|
void CollectDataForWatchpointCommandCallback(WatchpointOptions *wp_options,
|
|
|
|
|
CommandReturnObject &result) {
|
|
|
|
|
m_interpreter.GetLLDBCommandsFromIOHandler(
|
|
|
|
|
"> ", // Prompt
|
|
|
|
|
*this, // IOHandlerDelegate
|
|
|
|
|
wp_options); // Baton for the "io_handler" that will be passed back into
|
|
|
|
|
// our IOHandlerDelegate functions
|
2016-09-06 20:57:50 +00:00
|
|
|
}
|
|
|
|
|
|
2012-08-09 23:09:42 +00:00
|
|
|
/// Set a one-liner as the callback for the watchpoint.
|
|
|
|
|
void SetWatchpointCommandCallback(WatchpointOptions *wp_options,
|
|
|
|
|
const char *oneliner) {
|
2019-02-13 06:25:41 +00:00
|
|
|
std::unique_ptr<WatchpointOptions::CommandData> data_up(
|
2013-04-18 22:45:39 +00:00
|
|
|
new WatchpointOptions::CommandData());
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2018-04-30 16:49:04 +00:00
|
|
|
// It's necessary to set both user_source and script_source to the
|
|
|
|
|
// oneliner. The former is used to generate callback description (as in
|
|
|
|
|
// watchpoint command list) while the latter is used for Python to
|
|
|
|
|
// interpret during the actual callback.
|
2019-02-13 06:25:41 +00:00
|
|
|
data_up->user_source.AppendString(oneliner);
|
|
|
|
|
data_up->script_source.assign(oneliner);
|
|
|
|
|
data_up->stop_on_error = m_options.m_stop_on_error;
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2016-09-13 17:53:38 +00:00
|
|
|
auto baton_sp =
|
2019-02-13 06:25:41 +00:00
|
|
|
std::make_shared<WatchpointOptions::CommandBaton>(std::move(data_up));
|
2012-08-09 23:09:42 +00:00
|
|
|
wp_options->SetCallback(WatchpointOptionsCallbackFunction, baton_sp);
|
2016-09-06 20:57:50 +00:00
|
|
|
}
|
|
|
|
|
|
2012-08-09 23:09:42 +00:00
|
|
|
static bool
|
|
|
|
|
WatchpointOptionsCallbackFunction(void *baton,
|
|
|
|
|
StoppointCallbackContext *context,
|
|
|
|
|
lldb::user_id_t watch_id) {
|
|
|
|
|
bool ret_value = true;
|
2016-02-23 01:43:44 +00:00
|
|
|
if (baton == nullptr)
|
2012-08-09 23:09:42 +00:00
|
|
|
return true;
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2012-08-09 23:09:42 +00:00
|
|
|
WatchpointOptions::CommandData *data =
|
|
|
|
|
(WatchpointOptions::CommandData *)baton;
|
|
|
|
|
StringList &commands = data->user_source;
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2012-08-09 23:09:42 +00:00
|
|
|
if (commands.GetSize() > 0) {
|
|
|
|
|
ExecutionContext exe_ctx(context->exe_ctx_ref);
|
|
|
|
|
Target *target = exe_ctx.GetTargetPtr();
|
|
|
|
|
if (target) {
|
|
|
|
|
Debugger &debugger = target->GetDebugger();
|
2020-06-09 10:21:09 -07:00
|
|
|
CommandReturnObject result(debugger.GetUseColor());
|
|
|
|
|
|
2012-08-09 23:09:42 +00:00
|
|
|
// Rig up the results secondary output stream to the debugger's, so the
|
2018-04-30 16:49:04 +00:00
|
|
|
// output will come out synchronously if the debugger is set up that
|
|
|
|
|
// way.
|
2025-02-20 11:13:46 -08:00
|
|
|
result.SetImmediateOutputStream(debugger.GetAsyncOutputStream());
|
|
|
|
|
result.SetImmediateErrorStream(debugger.GetAsyncErrorStream());
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2014-10-11 00:38:27 +00:00
|
|
|
CommandInterpreterRunOptions options;
|
|
|
|
|
options.SetStopOnContinue(true);
|
|
|
|
|
options.SetStopOnError(data->stop_on_error);
|
|
|
|
|
options.SetEchoCommands(false);
|
|
|
|
|
options.SetPrintResults(true);
|
2019-05-08 01:23:47 +00:00
|
|
|
options.SetPrintErrors(true);
|
2014-10-11 00:38:27 +00:00
|
|
|
options.SetAddToHistory(false);
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2020-12-18 16:36:15 +03:00
|
|
|
debugger.GetCommandInterpreter().HandleCommands(commands, exe_ctx,
|
2014-10-11 00:38:27 +00:00
|
|
|
options, result);
|
2012-08-09 23:09:42 +00:00
|
|
|
result.GetImmediateOutputStream()->Flush();
|
|
|
|
|
result.GetImmediateErrorStream()->Flush();
|
2016-09-06 20:57:50 +00:00
|
|
|
}
|
2012-08-09 23:09:42 +00:00
|
|
|
}
|
|
|
|
|
return ret_value;
|
2016-09-06 20:57:50 +00:00
|
|
|
}
|
|
|
|
|
|
2012-08-09 23:09:42 +00:00
|
|
|
class CommandOptions : public Options {
|
2016-09-06 20:57:50 +00:00
|
|
|
public:
|
2022-03-31 13:20:46 -07:00
|
|
|
CommandOptions() = default;
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2012-08-09 23:09:42 +00:00
|
|
|
~CommandOptions() override = default;
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2017-05-12 04:51:55 +00:00
|
|
|
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
|
|
|
|
|
ExecutionContext *execution_context) override {
|
|
|
|
|
Status error;
|
2013-04-18 22:45:39 +00:00
|
|
|
const int short_option = m_getopt_table[option_idx].val;
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2012-08-09 23:09:42 +00:00
|
|
|
switch (short_option) {
|
|
|
|
|
case 'o':
|
|
|
|
|
m_use_one_liner = true;
|
2020-01-28 20:23:46 +01:00
|
|
|
m_one_liner = std::string(option_arg);
|
2012-08-09 23:09:42 +00:00
|
|
|
break;
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2012-08-09 23:09:42 +00:00
|
|
|
case 's':
|
2018-04-10 09:03:59 +00:00
|
|
|
m_script_language = (lldb::ScriptLanguage)OptionArgParser::ToOptionEnum(
|
2016-11-12 16:56:47 +00:00
|
|
|
option_arg, GetDefinitions()[option_idx].enum_values,
|
|
|
|
|
eScriptLanguageNone, error);
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2019-12-21 22:20:03 -08:00
|
|
|
switch (m_script_language) {
|
|
|
|
|
case eScriptLanguagePython:
|
|
|
|
|
case eScriptLanguageLua:
|
|
|
|
|
m_use_script_language = true;
|
|
|
|
|
break;
|
|
|
|
|
case eScriptLanguageNone:
|
|
|
|
|
case eScriptLanguageUnknown:
|
|
|
|
|
m_use_script_language = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
2016-09-06 20:57:50 +00:00
|
|
|
break;
|
|
|
|
|
|
2012-08-09 23:09:42 +00:00
|
|
|
case 'e': {
|
|
|
|
|
bool success = false;
|
2018-04-10 09:03:59 +00:00
|
|
|
m_stop_on_error =
|
|
|
|
|
OptionArgParser::ToBoolean(option_arg, false, &success);
|
2012-08-09 23:09:42 +00:00
|
|
|
if (!success)
|
2024-08-27 10:59:31 -07:00
|
|
|
return Status::FromErrorStringWithFormatv(
|
|
|
|
|
"invalid value for stop-on-error: \"{0}\"", option_arg);
|
2012-08-09 23:09:42 +00:00
|
|
|
} break;
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2012-08-09 23:09:42 +00:00
|
|
|
case 'F':
|
|
|
|
|
m_use_one_liner = false;
|
2020-01-28 20:23:46 +01:00
|
|
|
m_function_name.assign(std::string(option_arg));
|
2016-09-06 20:57:50 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
2019-08-22 08:08:05 +00:00
|
|
|
llvm_unreachable("Unimplemented option");
|
2016-09-06 20:57:50 +00:00
|
|
|
}
|
2012-08-09 23:09:42 +00:00
|
|
|
return error;
|
|
|
|
|
}
|
|
|
|
|
|
2016-08-11 23:51:28 +00:00
|
|
|
void OptionParsingStarting(ExecutionContext *execution_context) override {
|
2012-08-09 23:09:42 +00:00
|
|
|
m_use_commands = true;
|
2016-02-23 01:43:44 +00:00
|
|
|
m_use_script_language = false;
|
|
|
|
|
m_script_language = eScriptLanguageNone;
|
|
|
|
|
|
2012-08-09 23:09:42 +00:00
|
|
|
m_use_one_liner = false;
|
|
|
|
|
m_stop_on_error = true;
|
|
|
|
|
m_one_liner.clear();
|
|
|
|
|
m_function_name.clear();
|
|
|
|
|
}
|
|
|
|
|
|
Convert option tables to ArrayRefs.
This change is very mechanical. All it does is change the
signature of `Options::GetDefinitions()` and `OptionGroup::
GetDefinitions()` to return an `ArrayRef<OptionDefinition>`
instead of a `const OptionDefinition *`. In the case of the
former, it deletes the sentinel entry from every table, and
in the case of the latter, it removes the `GetNumDefinitions()`
method from the interface. These are no longer necessary as
`ArrayRef` carries its own length.
In the former case, iteration was done by using a sentinel
entry, so there was no knowledge of length. Because of this
the individual option tables were allowed to be defined below
the corresponding class (after all, only a pointer was needed).
Now, however, the length must be known at compile time to
construct the `ArrayRef`, and as a result it is necessary to
move every option table before its corresponding class. This
results in this CL looking very big, but in terms of substance
there is not much here.
Differential revision: https://reviews.llvm.org/D24834
llvm-svn: 282188
2016-09-22 20:22:55 +00:00
|
|
|
llvm::ArrayRef<OptionDefinition> GetDefinitions() override {
|
2023-01-09 18:11:07 +01:00
|
|
|
return llvm::ArrayRef(g_watchpoint_command_add_options);
|
Convert option tables to ArrayRefs.
This change is very mechanical. All it does is change the
signature of `Options::GetDefinitions()` and `OptionGroup::
GetDefinitions()` to return an `ArrayRef<OptionDefinition>`
instead of a `const OptionDefinition *`. In the case of the
former, it deletes the sentinel entry from every table, and
in the case of the latter, it removes the `GetNumDefinitions()`
method from the interface. These are no longer necessary as
`ArrayRef` carries its own length.
In the former case, iteration was done by using a sentinel
entry, so there was no knowledge of length. Because of this
the individual option tables were allowed to be defined below
the corresponding class (after all, only a pointer was needed).
Now, however, the length must be known at compile time to
construct the `ArrayRef`, and as a result it is necessary to
move every option table before its corresponding class. This
results in this CL looking very big, but in terms of substance
there is not much here.
Differential revision: https://reviews.llvm.org/D24834
llvm-svn: 282188
2016-09-22 20:22:55 +00:00
|
|
|
}
|
2012-08-09 23:09:42 +00:00
|
|
|
|
|
|
|
|
// Instance variables to hold the values for command options.
|
|
|
|
|
|
|
|
|
|
bool m_use_commands = false;
|
|
|
|
|
bool m_use_script_language = false;
|
|
|
|
|
lldb::ScriptLanguage m_script_language = eScriptLanguageNone;
|
|
|
|
|
|
|
|
|
|
// Instance variables to hold the values for one_liner options.
|
|
|
|
|
bool m_use_one_liner = false;
|
|
|
|
|
std::string m_one_liner;
|
|
|
|
|
bool m_stop_on_error;
|
|
|
|
|
std::string m_function_name;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
protected:
|
2023-10-30 10:21:00 -10:00
|
|
|
void DoExecute(Args &command, CommandReturnObject &result) override {
|
2024-07-31 11:02:18 -07:00
|
|
|
Target &target = GetTarget();
|
2012-08-09 23:09:42 +00:00
|
|
|
|
2024-07-31 11:02:18 -07:00
|
|
|
const WatchpointList &watchpoints = target.GetWatchpointList();
|
2012-08-09 23:09:42 +00:00
|
|
|
size_t num_watchpoints = watchpoints.GetSize();
|
|
|
|
|
|
|
|
|
|
if (num_watchpoints == 0) {
|
|
|
|
|
result.AppendError("No watchpoints exist to have commands added");
|
2023-10-30 10:21:00 -10:00
|
|
|
return;
|
2012-08-09 23:09:42 +00:00
|
|
|
}
|
|
|
|
|
|
2019-12-21 22:20:03 -08:00
|
|
|
if (!m_options.m_function_name.empty()) {
|
|
|
|
|
if (!m_options.m_use_script_language) {
|
|
|
|
|
m_options.m_script_language = GetDebugger().GetScriptLanguage();
|
|
|
|
|
m_options.m_use_script_language = true;
|
|
|
|
|
}
|
2012-08-09 23:09:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::vector<uint32_t> valid_wp_ids;
|
|
|
|
|
if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(target, command,
|
|
|
|
|
valid_wp_ids)) {
|
2025-09-04 16:37:41 -07:00
|
|
|
result.AppendError("invalid watchpoints specification");
|
2023-10-30 10:21:00 -10:00
|
|
|
return;
|
2012-08-09 23:09:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result.SetStatus(eReturnStatusSuccessFinishNoResult);
|
|
|
|
|
const size_t count = valid_wp_ids.size();
|
|
|
|
|
for (size_t i = 0; i < count; ++i) {
|
|
|
|
|
uint32_t cur_wp_id = valid_wp_ids.at(i);
|
|
|
|
|
if (cur_wp_id != LLDB_INVALID_WATCH_ID) {
|
2024-07-31 11:02:18 -07:00
|
|
|
Watchpoint *wp = target.GetWatchpointList().FindByID(cur_wp_id).get();
|
2012-08-09 23:09:42 +00:00
|
|
|
// Sanity check wp first.
|
2016-02-23 01:43:44 +00:00
|
|
|
if (wp == nullptr)
|
|
|
|
|
continue;
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2012-08-09 23:09:42 +00:00
|
|
|
WatchpointOptions *wp_options = wp->GetOptions();
|
|
|
|
|
// Skip this watchpoint if wp_options is not good.
|
2016-02-23 01:43:44 +00:00
|
|
|
if (wp_options == nullptr)
|
|
|
|
|
continue;
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2018-04-30 16:49:04 +00:00
|
|
|
// If we are using script language, get the script interpreter in order
|
|
|
|
|
// to set or collect command callback. Otherwise, call the methods
|
|
|
|
|
// associated with this object.
|
2012-08-09 23:09:42 +00:00
|
|
|
if (m_options.m_use_script_language) {
|
2019-12-21 22:20:03 -08:00
|
|
|
ScriptInterpreter *script_interp = GetDebugger().GetScriptInterpreter(
|
|
|
|
|
/*can_create=*/true, m_options.m_script_language);
|
2012-08-09 23:09:42 +00:00
|
|
|
// Special handling for one-liner specified inline.
|
|
|
|
|
if (m_options.m_use_one_liner) {
|
2019-12-21 22:20:03 -08:00
|
|
|
script_interp->SetWatchpointCommandCallback(
|
[lldb] Fix {break,watch}point command function stopping behaviour
In order to run a {break,watch}point command, lldb can resolve to the
script interpreter to run an arbitrary piece of code or call into a
user-provided function. To do so, we will generate a wrapping function,
where we first copy lldb's internal dictionary keys into the
interpreter's global dictionary, copied inline the user code before
resetting the global dictionary to its previous state.
However, {break,watch}point commands can optionally return a value that
would tell lldb whether we should stop or not. This feature was
only implemented for breakpoint commands and since we inlined the user
code directly into the wrapping function, introducing an early return,
that caused lldb to let the interpreter global dictionary tinted with the
internal dictionary keys.
This patch fixes that issue while also adding the stopping behaviour to
watchpoint commands.
To do so, this patch refactors the {break,watch}point command creation
method, to let the lldb wrapper function generator know if the user code is
a function call or a arbitrary expression.
Then the wrapper generator, if the user input was a function call, the
wrapper function will call the user function and save the return value into
a variable. If the user input was an arbitrary expression, the wrapper will
inline it into a nested function, call the nested function and save the
return value into the same variable. After resetting the interpreter global
dictionary to its previous state, the generated wrapper function will return
the varible containing the return value.
rdar://105461140
Differential Revision: https://reviews.llvm.org/D144688
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-02-28 09:24:46 -08:00
|
|
|
wp_options, m_options.m_one_liner.c_str(),
|
|
|
|
|
/*is_callback=*/false);
|
2016-09-06 20:57:50 +00:00
|
|
|
}
|
2018-04-30 16:49:04 +00:00
|
|
|
// Special handling for using a Python function by name instead of
|
|
|
|
|
// extending the watchpoint callback data structures, we just
|
|
|
|
|
// automatize what the user would do manually: make their watchpoint
|
|
|
|
|
// command be a function call
|
2016-02-23 01:43:44 +00:00
|
|
|
else if (!m_options.m_function_name.empty()) {
|
[lldb] Fix {break,watch}point command function stopping behaviour
In order to run a {break,watch}point command, lldb can resolve to the
script interpreter to run an arbitrary piece of code or call into a
user-provided function. To do so, we will generate a wrapping function,
where we first copy lldb's internal dictionary keys into the
interpreter's global dictionary, copied inline the user code before
resetting the global dictionary to its previous state.
However, {break,watch}point commands can optionally return a value that
would tell lldb whether we should stop or not. This feature was
only implemented for breakpoint commands and since we inlined the user
code directly into the wrapping function, introducing an early return,
that caused lldb to let the interpreter global dictionary tinted with the
internal dictionary keys.
This patch fixes that issue while also adding the stopping behaviour to
watchpoint commands.
To do so, this patch refactors the {break,watch}point command creation
method, to let the lldb wrapper function generator know if the user code is
a function call or a arbitrary expression.
Then the wrapper generator, if the user input was a function call, the
wrapper function will call the user function and save the return value into
a variable. If the user input was an arbitrary expression, the wrapper will
inline it into a nested function, call the nested function and save the
return value into the same variable. After resetting the interpreter global
dictionary to its previous state, the generated wrapper function will return
the varible containing the return value.
rdar://105461140
Differential Revision: https://reviews.llvm.org/D144688
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-02-28 09:24:46 -08:00
|
|
|
std::string function_signature = m_options.m_function_name;
|
|
|
|
|
function_signature += "(frame, wp, internal_dict)";
|
2019-12-21 22:20:03 -08:00
|
|
|
script_interp->SetWatchpointCommandCallback(
|
[lldb] Fix {break,watch}point command function stopping behaviour
In order to run a {break,watch}point command, lldb can resolve to the
script interpreter to run an arbitrary piece of code or call into a
user-provided function. To do so, we will generate a wrapping function,
where we first copy lldb's internal dictionary keys into the
interpreter's global dictionary, copied inline the user code before
resetting the global dictionary to its previous state.
However, {break,watch}point commands can optionally return a value that
would tell lldb whether we should stop or not. This feature was
only implemented for breakpoint commands and since we inlined the user
code directly into the wrapping function, introducing an early return,
that caused lldb to let the interpreter global dictionary tinted with the
internal dictionary keys.
This patch fixes that issue while also adding the stopping behaviour to
watchpoint commands.
To do so, this patch refactors the {break,watch}point command creation
method, to let the lldb wrapper function generator know if the user code is
a function call or a arbitrary expression.
Then the wrapper generator, if the user input was a function call, the
wrapper function will call the user function and save the return value into
a variable. If the user input was an arbitrary expression, the wrapper will
inline it into a nested function, call the nested function and save the
return value into the same variable. After resetting the interpreter global
dictionary to its previous state, the generated wrapper function will return
the varible containing the return value.
rdar://105461140
Differential Revision: https://reviews.llvm.org/D144688
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-02-28 09:24:46 -08:00
|
|
|
wp_options, function_signature.c_str(), /*is_callback=*/true);
|
2016-09-06 20:57:50 +00:00
|
|
|
} else {
|
2019-12-21 22:20:03 -08:00
|
|
|
script_interp->CollectDataForWatchpointCommandCallback(wp_options,
|
|
|
|
|
result);
|
2016-09-06 20:57:50 +00:00
|
|
|
}
|
|
|
|
|
} else {
|
2012-08-09 23:09:42 +00:00
|
|
|
// Special handling for one-liner specified inline.
|
|
|
|
|
if (m_options.m_use_one_liner)
|
|
|
|
|
SetWatchpointCommandCallback(wp_options,
|
|
|
|
|
m_options.m_one_liner.c_str());
|
2016-09-06 20:57:50 +00:00
|
|
|
else
|
2012-08-09 23:09:42 +00:00
|
|
|
CollectDataForWatchpointCommandCallback(wp_options, result);
|
2016-09-06 20:57:50 +00:00
|
|
|
}
|
|
|
|
|
}
|
2012-08-09 23:09:42 +00:00
|
|
|
}
|
2016-09-06 20:57:50 +00:00
|
|
|
}
|
|
|
|
|
|
2012-08-09 23:09:42 +00:00
|
|
|
private:
|
|
|
|
|
CommandOptions m_options;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// CommandObjectWatchpointCommandDelete
|
|
|
|
|
|
|
|
|
|
class CommandObjectWatchpointCommandDelete : public CommandObjectParsed {
|
|
|
|
|
public:
|
|
|
|
|
CommandObjectWatchpointCommandDelete(CommandInterpreter &interpreter)
|
2016-02-23 01:43:44 +00:00
|
|
|
: CommandObjectParsed(interpreter, "delete",
|
|
|
|
|
"Delete the set of commands from a watchpoint.",
|
2019-08-31 09:41:25 +00:00
|
|
|
nullptr, eCommandRequiresTarget) {
|
2024-02-27 10:34:01 -08:00
|
|
|
AddSimpleArgumentList(eArgTypeWatchpointID);
|
2012-08-09 23:09:42 +00:00
|
|
|
}
|
|
|
|
|
|
2016-02-23 01:43:44 +00:00
|
|
|
~CommandObjectWatchpointCommandDelete() override = default;
|
2012-08-09 23:09:42 +00:00
|
|
|
|
|
|
|
|
protected:
|
2023-10-30 10:21:00 -10:00
|
|
|
void DoExecute(Args &command, CommandReturnObject &result) override {
|
2024-07-31 11:02:18 -07:00
|
|
|
Target &target = GetTarget();
|
2012-08-09 23:09:42 +00:00
|
|
|
|
2024-07-31 11:02:18 -07:00
|
|
|
const WatchpointList &watchpoints = target.GetWatchpointList();
|
2012-08-09 23:09:42 +00:00
|
|
|
size_t num_watchpoints = watchpoints.GetSize();
|
|
|
|
|
|
|
|
|
|
if (num_watchpoints == 0) {
|
|
|
|
|
result.AppendError("No watchpoints exist to have commands deleted");
|
2023-10-30 10:21:00 -10:00
|
|
|
return;
|
2012-08-09 23:09:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (command.GetArgumentCount() == 0) {
|
|
|
|
|
result.AppendError(
|
|
|
|
|
"No watchpoint specified from which to delete the commands");
|
2023-10-30 10:21:00 -10:00
|
|
|
return;
|
2012-08-09 23:09:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::vector<uint32_t> valid_wp_ids;
|
2013-07-02 02:09:46 +00:00
|
|
|
if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(target, command,
|
|
|
|
|
valid_wp_ids)) {
|
2025-09-04 16:37:41 -07:00
|
|
|
result.AppendError("invalid watchpoints specification");
|
2023-10-30 10:21:00 -10:00
|
|
|
return;
|
2012-08-09 23:09:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result.SetStatus(eReturnStatusSuccessFinishNoResult);
|
|
|
|
|
const size_t count = valid_wp_ids.size();
|
|
|
|
|
for (size_t i = 0; i < count; ++i) {
|
|
|
|
|
uint32_t cur_wp_id = valid_wp_ids.at(i);
|
|
|
|
|
if (cur_wp_id != LLDB_INVALID_WATCH_ID) {
|
2024-07-31 11:02:18 -07:00
|
|
|
Watchpoint *wp = target.GetWatchpointList().FindByID(cur_wp_id).get();
|
2012-08-09 23:09:42 +00:00
|
|
|
if (wp)
|
|
|
|
|
wp->ClearCallback();
|
|
|
|
|
} else {
|
|
|
|
|
result.AppendErrorWithFormat("Invalid watchpoint ID: %u.\n", cur_wp_id);
|
2023-10-30 10:21:00 -10:00
|
|
|
return;
|
2012-08-09 23:09:42 +00:00
|
|
|
}
|
|
|
|
|
}
|
2016-09-06 20:57:50 +00:00
|
|
|
}
|
2012-08-09 23:09:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// CommandObjectWatchpointCommandList
|
|
|
|
|
|
|
|
|
|
class CommandObjectWatchpointCommandList : public CommandObjectParsed {
|
|
|
|
|
public:
|
|
|
|
|
CommandObjectWatchpointCommandList(CommandInterpreter &interpreter)
|
2019-08-31 09:41:25 +00:00
|
|
|
: CommandObjectParsed(interpreter, "list",
|
|
|
|
|
"List the script or set of commands to be executed "
|
|
|
|
|
"when the watchpoint is hit.",
|
|
|
|
|
nullptr, eCommandRequiresTarget) {
|
2024-02-27 10:34:01 -08:00
|
|
|
AddSimpleArgumentList(eArgTypeWatchpointID);
|
2016-09-06 20:57:50 +00:00
|
|
|
}
|
|
|
|
|
|
2016-02-23 01:43:44 +00:00
|
|
|
~CommandObjectWatchpointCommandList() override = default;
|
2012-08-09 23:09:42 +00:00
|
|
|
|
|
|
|
|
protected:
|
2023-10-30 10:21:00 -10:00
|
|
|
void DoExecute(Args &command, CommandReturnObject &result) override {
|
2024-07-31 11:02:18 -07:00
|
|
|
Target &target = GetTarget();
|
2012-08-09 23:09:42 +00:00
|
|
|
|
2024-07-31 11:02:18 -07:00
|
|
|
const WatchpointList &watchpoints = target.GetWatchpointList();
|
2012-08-09 23:09:42 +00:00
|
|
|
size_t num_watchpoints = watchpoints.GetSize();
|
|
|
|
|
|
|
|
|
|
if (num_watchpoints == 0) {
|
|
|
|
|
result.AppendError("No watchpoints exist for which to list commands");
|
2023-10-30 10:21:00 -10:00
|
|
|
return;
|
2012-08-09 23:09:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (command.GetArgumentCount() == 0) {
|
|
|
|
|
result.AppendError(
|
|
|
|
|
"No watchpoint specified for which to list the commands");
|
2023-10-30 10:21:00 -10:00
|
|
|
return;
|
2012-08-09 23:09:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::vector<uint32_t> valid_wp_ids;
|
2013-07-02 02:09:46 +00:00
|
|
|
if (!CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(target, command,
|
|
|
|
|
valid_wp_ids)) {
|
2025-09-04 16:37:41 -07:00
|
|
|
result.AppendError("invalid watchpoints specification");
|
2023-10-30 10:21:00 -10:00
|
|
|
return;
|
2012-08-09 23:09:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result.SetStatus(eReturnStatusSuccessFinishNoResult);
|
|
|
|
|
const size_t count = valid_wp_ids.size();
|
|
|
|
|
for (size_t i = 0; i < count; ++i) {
|
|
|
|
|
uint32_t cur_wp_id = valid_wp_ids.at(i);
|
|
|
|
|
if (cur_wp_id != LLDB_INVALID_WATCH_ID) {
|
2024-07-31 11:02:18 -07:00
|
|
|
Watchpoint *wp = target.GetWatchpointList().FindByID(cur_wp_id).get();
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2012-08-09 23:09:42 +00:00
|
|
|
if (wp) {
|
|
|
|
|
const WatchpointOptions *wp_options = wp->GetOptions();
|
|
|
|
|
if (wp_options) {
|
|
|
|
|
// Get the callback baton associated with the current watchpoint.
|
|
|
|
|
const Baton *baton = wp_options->GetBaton();
|
|
|
|
|
if (baton) {
|
|
|
|
|
result.GetOutputStream().Printf("Watchpoint %u:\n", cur_wp_id);
|
2019-11-30 15:30:08 +01:00
|
|
|
baton->GetDescription(result.GetOutputStream().AsRawOstream(),
|
|
|
|
|
eDescriptionLevelFull,
|
|
|
|
|
result.GetOutputStream().GetIndentLevel() +
|
|
|
|
|
2);
|
2012-08-09 23:09:42 +00:00
|
|
|
} else {
|
|
|
|
|
result.AppendMessageWithFormat(
|
|
|
|
|
"Watchpoint %u does not have an associated command.\n",
|
|
|
|
|
cur_wp_id);
|
|
|
|
|
}
|
2016-09-06 20:57:50 +00:00
|
|
|
}
|
2012-08-09 23:09:42 +00:00
|
|
|
result.SetStatus(eReturnStatusSuccessFinishResult);
|
2016-09-06 20:57:50 +00:00
|
|
|
} else {
|
2012-08-09 23:09:42 +00:00
|
|
|
result.AppendErrorWithFormat("Invalid watchpoint ID: %u.\n",
|
|
|
|
|
cur_wp_id);
|
|
|
|
|
}
|
2016-09-06 20:57:50 +00:00
|
|
|
}
|
2012-08-09 23:09:42 +00:00
|
|
|
}
|
2016-09-06 20:57:50 +00:00
|
|
|
}
|
2012-08-09 23:09:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// CommandObjectWatchpointCommand
|
|
|
|
|
|
2016-07-14 22:03:10 +00:00
|
|
|
CommandObjectWatchpointCommand::CommandObjectWatchpointCommand(
|
|
|
|
|
CommandInterpreter &interpreter)
|
|
|
|
|
: CommandObjectMultiword(
|
|
|
|
|
interpreter, "command",
|
|
|
|
|
"Commands for adding, removing and examining LLDB commands "
|
2018-05-29 09:10:46 +00:00
|
|
|
"executed when the watchpoint is hit (watchpoint 'commands').",
|
2016-07-14 22:03:10 +00:00
|
|
|
"command <sub-command> [<sub-command-options>] <watchpoint-id>") {
|
2012-08-09 23:09:42 +00:00
|
|
|
CommandObjectSP add_command_object(
|
|
|
|
|
new CommandObjectWatchpointCommandAdd(interpreter));
|
|
|
|
|
CommandObjectSP delete_command_object(
|
|
|
|
|
new CommandObjectWatchpointCommandDelete(interpreter));
|
|
|
|
|
CommandObjectSP list_command_object(
|
|
|
|
|
new CommandObjectWatchpointCommandList(interpreter));
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2012-08-09 23:09:42 +00:00
|
|
|
add_command_object->SetCommandName("watchpoint command add");
|
|
|
|
|
delete_command_object->SetCommandName("watchpoint command delete");
|
|
|
|
|
list_command_object->SetCommandName("watchpoint command list");
|
2016-09-06 20:57:50 +00:00
|
|
|
|
2013-04-19 21:31:16 +00:00
|
|
|
LoadSubCommand("add", add_command_object);
|
|
|
|
|
LoadSubCommand("delete", delete_command_object);
|
|
|
|
|
LoadSubCommand("list", list_command_object);
|
2012-08-09 23:09:42 +00:00
|
|
|
}
|
|
|
|
|
|
2016-02-23 01:43:44 +00:00
|
|
|
CommandObjectWatchpointCommand::~CommandObjectWatchpointCommand() = default;
|