[Lldb-commits] [lldb] [lldb] Inline expression evaluator error visualization (PR #106470)
via lldb-commits
lldb-commits at lists.llvm.org
Wed Aug 28 16:26:25 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Adrian Prantl (adrian-prantl)
<details>
<summary>Changes</summary>
This patch is a reworking of Pete Lawrence's (@<!-- -->PortalPete) proposal
for better expression evaluator error messages:
https://github.com/llvm/llvm-project/pull/80938
Before:
```
$ lldb -o "expr a+b"
(lldb) expr a+b
error: <user expression 0>:1:1: use of undeclared identifier 'a'
a+b
^
error: <user expression 0>:1:3: use of undeclared identifier 'b'
a+b
^
```
After:
```
(lldb) expr a+b
^ ^
│ ╰─ error: use of undeclared identifier 'b'
╰─ error: use of undeclared identifier 'a'
```
This eliminates the confusing `<user expression 0>:1:3` source
location and avoids echoing the expression to the console again, which
results in a cleaner presentation that makes it easier to grasp what's
going on. You can't see it here, bug the word "error" is now also in color, if so desired.
Depends on https://github.com/llvm/llvm-project/pull/106442.
---
Patch is 150.30 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/106470.diff
70 Files Affected:
- (modified) lldb/include/lldb/Expression/DiagnosticManager.h (+22-28)
- (modified) lldb/include/lldb/Interpreter/CommandAlias.h (+1-1)
- (modified) lldb/include/lldb/Interpreter/CommandObject.h (+14-3)
- (modified) lldb/include/lldb/Interpreter/CommandObjectMultiword.h (+6-2)
- (modified) lldb/include/lldb/Utility/Status.h (+48-2)
- (modified) lldb/source/API/SBCommandInterpreter.cpp (+1-1)
- (modified) lldb/source/Commands/CommandObjectApropos.cpp (+1-1)
- (modified) lldb/source/Commands/CommandObjectApropos.h (+1-1)
- (modified) lldb/source/Commands/CommandObjectBreakpoint.cpp (+13-13)
- (modified) lldb/source/Commands/CommandObjectBreakpointCommand.cpp (+3-4)
- (modified) lldb/source/Commands/CommandObjectCommands.cpp (+15-15)
- (modified) lldb/source/Commands/CommandObjectDWIMPrint.cpp (+1-1)
- (modified) lldb/source/Commands/CommandObjectDWIMPrint.h (+1-1)
- (modified) lldb/source/Commands/CommandObjectDiagnostics.cpp (+1-1)
- (modified) lldb/source/Commands/CommandObjectDisassemble.cpp (+1-1)
- (modified) lldb/source/Commands/CommandObjectDisassemble.h (+1-1)
- (modified) lldb/source/Commands/CommandObjectExpression.cpp (+117-8)
- (modified) lldb/source/Commands/CommandObjectExpression.h (+5-3)
- (modified) lldb/source/Commands/CommandObjectFrame.cpp (+10-10)
- (modified) lldb/source/Commands/CommandObjectGUI.cpp (+1-1)
- (modified) lldb/source/Commands/CommandObjectGUI.h (+1-1)
- (modified) lldb/source/Commands/CommandObjectHelp.cpp (+1-1)
- (modified) lldb/source/Commands/CommandObjectHelp.h (+1-1)
- (modified) lldb/source/Commands/CommandObjectLanguage.h (+1-1)
- (modified) lldb/source/Commands/CommandObjectLog.cpp (+9-9)
- (modified) lldb/source/Commands/CommandObjectMemory.cpp (+5-5)
- (modified) lldb/source/Commands/CommandObjectMemoryTag.cpp (+2-2)
- (modified) lldb/source/Commands/CommandObjectMultiword.cpp (+4-3)
- (modified) lldb/source/Commands/CommandObjectPlatform.cpp (+22-22)
- (modified) lldb/source/Commands/CommandObjectPlugin.cpp (+1-1)
- (modified) lldb/source/Commands/CommandObjectProcess.cpp (+14-14)
- (modified) lldb/source/Commands/CommandObjectQuit.cpp (+1-1)
- (modified) lldb/source/Commands/CommandObjectQuit.h (+1-1)
- (modified) lldb/source/Commands/CommandObjectRegexCommand.cpp (+1-1)
- (modified) lldb/source/Commands/CommandObjectRegexCommand.h (+1-1)
- (modified) lldb/source/Commands/CommandObjectRegister.cpp (+3-3)
- (modified) lldb/source/Commands/CommandObjectScripting.cpp (+2-2)
- (modified) lldb/source/Commands/CommandObjectSession.cpp (+2-2)
- (modified) lldb/source/Commands/CommandObjectSettings.cpp (+11-11)
- (modified) lldb/source/Commands/CommandObjectSource.cpp (+4-4)
- (modified) lldb/source/Commands/CommandObjectStats.cpp (+3-3)
- (modified) lldb/source/Commands/CommandObjectTarget.cpp (+31-31)
- (modified) lldb/source/Commands/CommandObjectThread.cpp (+13-13)
- (modified) lldb/source/Commands/CommandObjectThreadUtil.cpp (+2-2)
- (modified) lldb/source/Commands/CommandObjectThreadUtil.h (+2-2)
- (modified) lldb/source/Commands/CommandObjectTrace.cpp (+4-4)
- (modified) lldb/source/Commands/CommandObjectType.cpp (+15-15)
- (modified) lldb/source/Commands/CommandObjectVersion.cpp (+1-1)
- (modified) lldb/source/Commands/CommandObjectVersion.h (+1-1)
- (modified) lldb/source/Commands/CommandObjectWatchpoint.cpp (+8-8)
- (modified) lldb/source/Commands/CommandObjectWatchpointCommand.cpp (+3-3)
- (modified) lldb/source/Expression/DiagnosticManager.cpp (+27)
- (modified) lldb/source/Expression/UserExpression.cpp (+13-13)
- (modified) lldb/source/Interpreter/CommandAlias.cpp (+1)
- (modified) lldb/source/Interpreter/CommandInterpreter.cpp (+7-2)
- (modified) lldb/source/Interpreter/CommandObject.cpp (+4-2)
- (modified) lldb/source/Plugins/ExpressionParser/Clang/ClangDiagnostic.h (+2-3)
- (modified) lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp (+40-7)
- (modified) lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp (+1-1)
- (modified) lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp (+2-2)
- (modified) lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp (+1-1)
- (modified) lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (+5-5)
- (modified) lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp (+2-2)
- (modified) lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp (+2-2)
- (modified) lldb/source/Plugins/TraceExporter/ctf/CommandObjectThreadTraceExportCTF.cpp (+1-1)
- (modified) lldb/source/Plugins/TraceExporter/ctf/CommandObjectThreadTraceExportCTF.h (+1-1)
- (modified) lldb/source/Utility/Status.cpp (+22-7)
- (modified) lldb/test/API/lang/objc/modules-compile-error/TestModulesCompileError.py (+1-1)
- (modified) lldb/unittests/Expression/DiagnosticManagerTest.cpp (+6-6)
- (modified) lldb/unittests/Interpreter/TestCommandPaths.cpp (+2-1)
``````````diff
diff --git a/lldb/include/lldb/Expression/DiagnosticManager.h b/lldb/include/lldb/Expression/DiagnosticManager.h
index d49b7c99b114fb..252492ce8f776a 100644
--- a/lldb/include/lldb/Expression/DiagnosticManager.h
+++ b/lldb/include/lldb/Expression/DiagnosticManager.h
@@ -12,6 +12,8 @@
#include "lldb/lldb-defines.h"
#include "lldb/lldb-types.h"
+#include "lldb/Utility/Status.h"
+
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
@@ -49,37 +51,28 @@ class Diagnostic {
}
}
- Diagnostic(llvm::StringRef message, lldb::Severity severity,
- DiagnosticOrigin origin, uint32_t compiler_id)
- : m_message(message), m_severity(severity), m_origin(origin),
- m_compiler_id(compiler_id) {}
-
- Diagnostic(const Diagnostic &rhs)
- : m_message(rhs.m_message), m_severity(rhs.m_severity),
- m_origin(rhs.m_origin), m_compiler_id(rhs.m_compiler_id) {}
+ Diagnostic(DiagnosticOrigin origin, uint32_t compiler_id,
+ Status::Detail detail)
+ : m_origin(origin), m_compiler_id(compiler_id), m_detail(detail) {}
virtual ~Diagnostic() = default;
virtual bool HasFixIts() const { return false; }
- lldb::Severity GetSeverity() const { return m_severity; }
+ lldb::Severity GetSeverity() const { return m_detail.severity; }
uint32_t GetCompilerID() const { return m_compiler_id; }
- llvm::StringRef GetMessage() const { return m_message; }
+ llvm::StringRef GetMessage() const { return m_detail.message; }
+ Status::Detail GetDetail() const { return m_detail; }
- void AppendMessage(llvm::StringRef message,
- bool precede_with_newline = true) {
- if (precede_with_newline)
- m_message.push_back('\n');
- m_message += message;
- }
+ void AppendMessage(llvm::StringRef message, bool precede_with_newline = true);
protected:
- std::string m_message;
- lldb::Severity m_severity;
DiagnosticOrigin m_origin;
- uint32_t m_compiler_id; // Compiler-specific diagnostic ID
+ /// Compiler-specific diagnostic ID.
+ uint32_t m_compiler_id;
+ Status::Detail m_detail;
};
typedef std::vector<std::unique_ptr<Diagnostic>> DiagnosticList;
@@ -102,10 +95,7 @@ class DiagnosticManager {
void AddDiagnostic(llvm::StringRef message, lldb::Severity severity,
DiagnosticOrigin origin,
- uint32_t compiler_id = LLDB_INVALID_COMPILER_ID) {
- m_diagnostics.emplace_back(
- std::make_unique<Diagnostic>(message, severity, origin, compiler_id));
- }
+ uint32_t compiler_id = LLDB_INVALID_COMPILER_ID);
void AddDiagnostic(std::unique_ptr<Diagnostic> diagnostic) {
if (diagnostic)
@@ -130,13 +120,17 @@ class DiagnosticManager {
m_diagnostics.back()->AppendMessage(str);
}
- // Returns a string containing errors in this format:
- //
- // "error: error text\n
- // warning: warning text\n
- // remark text\n"
+ /// Returns a string containing errors in this format:
+ ///
+ /// "error: error text\n
+ /// warning: warning text\n
+ /// remark text\n"
+ LLVM_DEPRECATED("Use GetAsStatus instead", "GetAsStatus()")
std::string GetString(char separator = '\n');
+ /// Copies the diagnostics into an lldb::Status.
+ Status GetAsStatus(lldb::ExpressionResults result);
+
void Dump(Log *log);
const std::string &GetFixedExpression() { return m_fixed_expression; }
diff --git a/lldb/include/lldb/Interpreter/CommandAlias.h b/lldb/include/lldb/Interpreter/CommandAlias.h
index 7b59ea0a74bb9e..778d656a845506 100644
--- a/lldb/include/lldb/Interpreter/CommandAlias.h
+++ b/lldb/include/lldb/Interpreter/CommandAlias.h
@@ -56,7 +56,7 @@ class CommandAlias : public CommandObject {
void SetHelpLong(llvm::StringRef str) override;
- void Execute(const char *args_string, CommandReturnObject &result) override;
+ void Execute(const char *args_string, std::optional<uint16_t> offset_in_command,CommandReturnObject &result) override;
lldb::CommandObjectSP GetUnderlyingCommand() {
return m_underlying_command_sp;
diff --git a/lldb/include/lldb/Interpreter/CommandObject.h b/lldb/include/lldb/Interpreter/CommandObject.h
index 20c4769af90338..9319b15f1be4dc 100644
--- a/lldb/include/lldb/Interpreter/CommandObject.h
+++ b/lldb/include/lldb/Interpreter/CommandObject.h
@@ -340,7 +340,11 @@ class CommandObject : public std::enable_shared_from_this<CommandObject> {
return false;
}
+ /// \param offset_in_command is on what column \c args_string
+ /// appears, if applicable. This enables diagnostics that refer back
+ /// to the user input.
virtual void Execute(const char *args_string,
+ std::optional<uint16_t> offset_in_command,
CommandReturnObject &result) = 0;
protected:
@@ -421,10 +425,14 @@ class CommandObjectParsed : public CommandObject {
~CommandObjectParsed() override = default;
- void Execute(const char *args_string, CommandReturnObject &result) override;
+ void Execute(const char *args_string,
+ std::optional<uint16_t> offset_in_command,
+ CommandReturnObject &result) override;
protected:
- virtual void DoExecute(Args &command, CommandReturnObject &result) = 0;
+ virtual void DoExecute(Args &command,
+ std::optional<uint16_t> offset_in_command,
+ CommandReturnObject &result) = 0;
bool WantsRawCommandString() override { return false; }
};
@@ -438,10 +446,13 @@ class CommandObjectRaw : public CommandObject {
~CommandObjectRaw() override = default;
- void Execute(const char *args_string, CommandReturnObject &result) override;
+ void Execute(const char *args_string,
+ std::optional<uint16_t> offset_in_command,
+ CommandReturnObject &result) override;
protected:
virtual void DoExecute(llvm::StringRef command,
+ std::optional<uint16_t> offset_in_command,
CommandReturnObject &result) = 0;
bool WantsRawCommandString() override { return true; }
diff --git a/lldb/include/lldb/Interpreter/CommandObjectMultiword.h b/lldb/include/lldb/Interpreter/CommandObjectMultiword.h
index bceb7f0e51edb6..6f7c798dfeae69 100644
--- a/lldb/include/lldb/Interpreter/CommandObjectMultiword.h
+++ b/lldb/include/lldb/Interpreter/CommandObjectMultiword.h
@@ -59,7 +59,9 @@ class CommandObjectMultiword : public CommandObject {
std::optional<std::string> GetRepeatCommand(Args ¤t_command_args,
uint32_t index) override;
- void Execute(const char *args_string, CommandReturnObject &result) override;
+ void Execute(const char *args_string,
+ std::optional<uint16_t> offset_in_command,
+ CommandReturnObject &result) override;
bool IsRemovable() const override { return m_can_be_removed; }
@@ -129,7 +131,9 @@ class CommandObjectProxy : public CommandObject {
/// Execute is called) and \a GetProxyCommandObject returned null.
virtual llvm::StringRef GetUnsupportedError();
- void Execute(const char *args_string, CommandReturnObject &result) override;
+ void Execute(const char *args_string,
+ std::optional<uint16_t> offset_in_command,
+ CommandReturnObject &result) override;
protected:
// These two want to iterate over the subcommand dictionary.
diff --git a/lldb/include/lldb/Utility/Status.h b/lldb/include/lldb/Utility/Status.h
index b304291ffae00e..5a9683e09c6e53 100644
--- a/lldb/include/lldb/Utility/Status.h
+++ b/lldb/include/lldb/Utility/Status.h
@@ -9,6 +9,7 @@
#ifndef LLDB_UTILITY_STATUS_H
#define LLDB_UTILITY_STATUS_H
+#include "lldb/Utility/FileSpec.h"
#include "lldb/lldb-defines.h"
#include "lldb/lldb-enumerations.h"
#include "llvm/ADT/StringRef.h"
@@ -47,7 +48,34 @@ class Status {
/// into ValueType.
typedef uint32_t ValueType;
- Status();
+ /// A customizable "detail" for an error. For example, expression
+ /// evaluation failures often have more than one diagnostic that the
+ /// UI layer might want to render differently.
+ ///
+ /// Running example:
+ /// (lldb) expr 1+x
+ /// error: <user expression 0>:1:3: use of undeclared identifier 'foo'
+ /// 1+foo
+ /// ^
+ struct Detail {
+ struct SourceLocation {
+ FileSpec file;
+ unsigned line = 0;
+ uint16_t column = 0;
+ uint16_t length = 0;
+ bool in_user_input = false;
+ };
+ /// Contains {{}, 1, 3, 3, true} in the example above.
+ std::optional<SourceLocation> source_location;
+ /// Contains eSeverityError in the example above.
+ lldb::Severity severity = lldb::eSeverityInfo;
+ /// Contains "use of undeclared identifier 'x'" in the example above.
+ std::string message;
+ /// Contains the fully rendered error message.
+ std::string rendered;
+ };
+
+ Status() = default;
/// Initialize the error object with a generic success value.
///
@@ -57,7 +85,8 @@ class Status {
/// \param[in] type
/// The type for \a err.
explicit Status(ValueType err, lldb::ErrorType type = lldb::eErrorTypeGeneric,
- std::string msg = {});
+ std::string msg = {})
+ : m_code(err), m_type(type), m_string(std::move(msg)) {}
Status(std::error_code EC);
@@ -83,6 +112,12 @@ class Status {
return Status(result, lldb::eErrorTypeExpression, msg);
}
+ static Status
+ FromExpressionErrorDetails(lldb::ExpressionResults result,
+ llvm::SmallVectorImpl<Detail> &&details) {
+ return Status(result, lldb::eErrorTypeExpression, std::move(details));
+ }
+
/// Set the current error to errno.
///
/// Update the error value to be \c errno and update the type to be \c
@@ -144,13 +179,24 @@ class Status {
/// success (non-erro), \b false otherwise.
bool Success() const;
+ /// Get the list of details for this error. If this is non-empty,
+ /// clients can use this to render more appealing error messages
+ /// from the details. If you just want a pre-rendered string, use
+ /// AsCString() instead. Currently details are only used for
+ /// eErrorTypeExpression.
+ llvm::ArrayRef<Detail> GetDetails() const;
+
protected:
+ /// Separate so the main constructor doesn't need to deal with the array.
+ Status(ValueType err, lldb::ErrorType type,
+ llvm::SmallVectorImpl<Detail> &&details);
/// Status code as an integer value.
ValueType m_code = 0;
/// The type of the above error code.
lldb::ErrorType m_type = lldb::eErrorTypeInvalid;
/// A string representation of the error code.
mutable std::string m_string;
+ llvm::SmallVector<Detail, 0> m_details;
};
} // namespace lldb_private
diff --git a/lldb/source/API/SBCommandInterpreter.cpp b/lldb/source/API/SBCommandInterpreter.cpp
index 7a35473283684c..d9d769456ae594 100644
--- a/lldb/source/API/SBCommandInterpreter.cpp
+++ b/lldb/source/API/SBCommandInterpreter.cpp
@@ -71,7 +71,7 @@ class CommandPluginInterfaceImplementation : public CommandObjectParsed {
}
protected:
- void DoExecute(Args &command, CommandReturnObject &result) override {
+ void DoExecute(Args &command, std::optional<uint16_t> offset_in_command, CommandReturnObject &result) override {
SBCommandReturnObject sb_return(result);
SBCommandInterpreter sb_interpreter(&m_interpreter);
SBDebugger debugger_sb(m_interpreter.GetDebugger().shared_from_this());
diff --git a/lldb/source/Commands/CommandObjectApropos.cpp b/lldb/source/Commands/CommandObjectApropos.cpp
index d663f2bd923fe2..13d1225f83fe6e 100644
--- a/lldb/source/Commands/CommandObjectApropos.cpp
+++ b/lldb/source/Commands/CommandObjectApropos.cpp
@@ -26,7 +26,7 @@ CommandObjectApropos::CommandObjectApropos(CommandInterpreter &interpreter)
CommandObjectApropos::~CommandObjectApropos() = default;
-void CommandObjectApropos::DoExecute(Args &args, CommandReturnObject &result) {
+void CommandObjectApropos::DoExecute(Args &args, std::optional<uint16_t> offset_in_command, CommandReturnObject &result) {
const size_t argc = args.GetArgumentCount();
if (argc == 1) {
diff --git a/lldb/source/Commands/CommandObjectApropos.h b/lldb/source/Commands/CommandObjectApropos.h
index f43420c1815d90..da83701cb15a7b 100644
--- a/lldb/source/Commands/CommandObjectApropos.h
+++ b/lldb/source/Commands/CommandObjectApropos.h
@@ -23,7 +23,7 @@ class CommandObjectApropos : public CommandObjectParsed {
~CommandObjectApropos() override;
protected:
- void DoExecute(Args &command, CommandReturnObject &result) override;
+ void DoExecute(Args &command, std::optional<uint16_t> offset_in_command, CommandReturnObject &result) override;
};
} // namespace lldb_private
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp
index abde27b2b53ad8..46aad494e27a4e 100644
--- a/lldb/source/Commands/CommandObjectBreakpoint.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp
@@ -538,7 +538,7 @@ class CommandObjectBreakpointSet : public CommandObjectParsed {
};
protected:
- void DoExecute(Args &command, CommandReturnObject &result) override {
+ void DoExecute(Args &args, std::optional<uint16_t> offset_in_command, CommandReturnObject &result) override {
Target &target =
m_dummy_options.m_use_dummy ? GetDummyTarget() : GetTarget();
@@ -839,7 +839,7 @@ class CommandObjectBreakpointModify : public CommandObjectParsed {
Options *GetOptions() override { return &m_options; }
protected:
- void DoExecute(Args &command, CommandReturnObject &result) override {
+ void DoExecute(Args &command, std::optional<uint16_t> offset_in_command, CommandReturnObject &result) override {
Target &target = m_dummy_opts.m_use_dummy ? GetDummyTarget() : GetTarget();
std::unique_lock<std::recursive_mutex> lock;
@@ -903,7 +903,7 @@ class CommandObjectBreakpointEnable : public CommandObjectParsed {
}
protected:
- void DoExecute(Args &command, CommandReturnObject &result) override {
+ void DoExecute(Args &command, std::optional<uint16_t> offset_in_command, CommandReturnObject &result) override {
Target &target = GetTarget();
std::unique_lock<std::recursive_mutex> lock;
@@ -1010,7 +1010,7 @@ the second re-enables the first location.");
}
protected:
- void DoExecute(Args &command, CommandReturnObject &result) override {
+ void DoExecute(Args &command, std::optional<uint16_t> offset_in_command, CommandReturnObject &result) override {
Target &target = GetTarget();
std::unique_lock<std::recursive_mutex> lock;
target.GetBreakpointList().GetListMutex(lock);
@@ -1148,7 +1148,7 @@ class CommandObjectBreakpointList : public CommandObjectParsed {
};
protected:
- void DoExecute(Args &command, CommandReturnObject &result) override {
+ void DoExecute(Args &command, std::optional<uint16_t> offset_in_command, CommandReturnObject &result) override {
Target &target = m_options.m_use_dummy ? GetDummyTarget() : GetTarget();
const BreakpointList &breakpoints =
@@ -1267,7 +1267,7 @@ class CommandObjectBreakpointClear : public CommandObjectParsed {
};
protected:
- void DoExecute(Args &command, CommandReturnObject &result) override {
+ void DoExecute(Args &command, std::optional<uint16_t> offset_in_command, CommandReturnObject &result) override {
Target &target = GetTarget();
// The following are the various types of breakpoints that could be
@@ -1416,7 +1416,7 @@ class CommandObjectBreakpointDelete : public CommandObjectParsed {
};
protected:
- void DoExecute(Args &command, CommandReturnObject &result) override {
+ void DoExecute(Args &command, std::optional<uint16_t> offset_in_command, CommandReturnObject &result) override {
Target &target = m_options.m_use_dummy ? GetDummyTarget() : GetTarget();
result.Clear();
@@ -1669,7 +1669,7 @@ class CommandObjectBreakpointNameConfigure : public CommandObjectParsed {
Options *GetOptions() override { return &m_option_group; }
protected:
- void DoExecute(Args &command, CommandReturnObject &result) override {
+ void DoExecute(Args &command, std::optional<uint16_t> offset_in_command, CommandReturnObject &result) override {
const size_t argc = command.GetArgumentCount();
if (argc == 0) {
@@ -1758,7 +1758,7 @@ class CommandObjectBreakpointNameAdd : public CommandObjectParsed {
Options *GetOptions() override { return &m_option_group; }
protected:
- void DoExecute(Args &command, CommandReturnObject &result) override {
+ void DoExecute(Args &command, std::optional<uint16_t> offset_in_command, CommandReturnObject &result) override {
if (!m_name_options.m_name.OptionWasSet()) {
result.AppendError("No name option provided.");
return;
@@ -1832,7 +1832,7 @@ class CommandObjectBreakpointNameDelete : public CommandObjectParsed {
Options *GetOptions() override { return &m_option_group; }
protected:
- void DoExecute(Args &command, CommandReturnObject &result) override {
+ void DoExecute(Args &command, std::optional<uint16_t> offset_in_command, CommandReturnObject &result) override {
if (!m_name_options.m_name.OptionWasSet()) {
result.AppendError("No name option provided.");
return;
@@ -1896,7 +1896,7 @@ class CommandObjectBreakpointNameList : public CommandObjectParsed {
Options *GetOptions() override { return &m_option_group; }
protected:
- void DoExecute(Args &command, CommandReturnObject &result) override {
+ void DoExecute(Args &command, std::optional<uint16_t> offset_in_command, CommandReturnObject &result) override {
Target &target =
m_name_options.m_use_dummy ? GetDummyTarget() : GetTarget();
@@ -2209,7 +2209,7 @@ class CommandObjectBreakpointRead : public CommandObjectParsed {
};
protected:
- void DoExecute(Args &command, CommandReturnObject &result) override {
+ void DoExecute(Args &command, std::optional<uint16_t> offset_in_command, CommandReturnObject &result) override {
Target &target = GetTarget();
std::unique_lock<std::recursive_mutex> lock;
@@ -2319,7 +2319,7 @@ class CommandObjectBreakpointWrite : public CommandObjectParsed {
};
protected:
- void DoExecute(Args &command, CommandReturnObject &result) override {
+ void DoExecute(Args &command, std::optional<uint16_t> offset_in_command, CommandReturnObject &result) override {
Target &target = GetTarget();
std::unique_lock<std::recursive_mutex> lock;
diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
index b668cd0f7c22f0..08b72bc26c3b75 100644
--- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
@@ -319,9 +319,8 @@ are no syntax errors may indicate that a function was declared but never called.
bool m_stop_on_error;
bool m_use_dummy;
};
-
protected:
- void DoExecute(Args &command, CommandReturnObject &result) override {
+ void DoExecute(Args &command, std::optional<uint16_t> offset_in_command, CommandReturnObject &result) override {
Target &target = m_options.m_use_dummy ? GetDummyTarget() : GetTarget();
const BreakpointList &breakpoints = target.GetBreakpointList();
@@ -479,7 +478,7 @@ class CommandObjectBreakpointCommandDelete : public CommandObjectParsed {
};
protected:
- void DoExecute(Args &command, CommandReturnObject &result) override {
+ void DoExecute(Args &command, std::optional<uint16_t> offset_in_command, CommandReturnObject &result) override {
Target &target = m_options.m_use_dummy ? GetDummyTarget() : GetTarget();
const BreakpointList &breakpoints = target.GetBreakpointList();
@@ -546,7 +545,7 @@ class CommandObjectBreakpointCommandList : public CommandObjectParsed {
~CommandObjectBreakpointCommandList() override = default;
protected:
- void DoExecute(Args &command, CommandReturnObject &result) override {
+ void DoExecute(Args &command, std::optional<uint16_t> offset_in_command, CommandReturnObject &result) override {
Target &target = GetTarget();
const BreakpointList &breakpoints = target.GetBreakpointList();
diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp
index f8f2b97eb898fa..961bae2dd1d55b 100644
--- a/lldb/source/Commands/CommandO...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/106470
More information about the lldb-commits
mailing list