Author: Dave Lee Date: 2026-05-14T12:50:48-07:00 New Revision: 26a4ffb3af13e0bd34693f32755b460f495d7c50
URL: https://github.com/llvm/llvm-project/commit/26a4ffb3af13e0bd34693f32755b460f495d7c50 DIFF: https://github.com/llvm/llvm-project/commit/26a4ffb3af13e0bd34693f32755b460f495d7c50.diff LOG: [lldb] Update calls to VerifyBreakpointIDs to handle dummy targets (#197088) Follow up to #194272. In that change, `VerifyBreakpointIDs` had its signature changed to take an `ExecutionContext` instead of a `Target`. In updating the call-sites, `m_exe_ctx` was used. However, in some of those places, the `target` argument reflected the use of a dummy target. The switch broke situations where a proper target does not exist. This update changes those calls back to using the `target` variable, which may be the dummy target. The `const` change to `ExecutionContext &` parameters is to support the passing of `&target`. Added: Modified: lldb/include/lldb/Breakpoint/BreakpointIDList.h lldb/source/Breakpoint/BreakpointIDList.cpp lldb/source/Commands/CommandObjectBreakpoint.cpp lldb/source/Commands/CommandObjectBreakpoint.h lldb/source/Commands/CommandObjectBreakpointCommand.cpp Removed: ################################################################################ diff --git a/lldb/include/lldb/Breakpoint/BreakpointIDList.h b/lldb/include/lldb/Breakpoint/BreakpointIDList.h index 3354a3a24893a..da38a85e2dd80 100644 --- a/lldb/include/lldb/Breakpoint/BreakpointIDList.h +++ b/lldb/include/lldb/Breakpoint/BreakpointIDList.h @@ -51,7 +51,7 @@ class BreakpointIDList { SplitIDRangeExpression(llvm::StringRef in_string); static llvm::Error FindAndReplaceIDRanges( - Args &old_args, ExecutionContext &exe_ctx, bool allow_locations, + Args &old_args, const ExecutionContext &exe_ctx, bool allow_locations, BreakpointName::Permissions ::PermissionKinds purpose, Args &new_args); private: diff --git a/lldb/source/Breakpoint/BreakpointIDList.cpp b/lldb/source/Breakpoint/BreakpointIDList.cpp index 82850d9e10b3e..587a48cc25af6 100644 --- a/lldb/source/Breakpoint/BreakpointIDList.cpp +++ b/lldb/source/Breakpoint/BreakpointIDList.cpp @@ -83,7 +83,7 @@ static std::string LocationIDForStop(StopInfoSP stop_info_sp, uint32_t idx) { // by the members of the range. llvm::Error BreakpointIDList::FindAndReplaceIDRanges( - Args &old_args, ExecutionContext &exe_ctx, bool allow_locations, + Args &old_args, const ExecutionContext &exe_ctx, bool allow_locations, BreakpointName::Permissions ::PermissionKinds purpose, Args &new_args) { Target *target = exe_ctx.GetTargetPtr(); llvm::StringRef range_from; diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index 98e45495c48ad..0ac0663d428fa 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -2073,7 +2073,7 @@ class CommandObjectBreakpointModify : public CommandObjectParsed { BreakpointIDList valid_bp_ids; CommandObjectMultiwordBreakpoint::VerifyBreakpointOrLocationIDs( - command, m_exe_ctx, result, &valid_bp_ids, + command, &target, result, &valid_bp_ids, BreakpointName::Permissions::PermissionKinds::disablePerm); if (result.Succeeded()) { @@ -2406,7 +2406,7 @@ class CommandObjectBreakpointList : public CommandObjectParsed { // Particular breakpoints selected; show info about that breakpoint. BreakpointIDList valid_bp_ids; CommandObjectMultiwordBreakpoint::VerifyBreakpointOrLocationIDs( - command, m_exe_ctx, result, &valid_bp_ids, + command, &target, result, &valid_bp_ids, BreakpointName::Permissions::PermissionKinds::listPerm); if (result.Succeeded()) { @@ -2685,7 +2685,7 @@ class CommandObjectBreakpointDelete : public CommandObjectParsed { if (!command.empty()) { CommandObjectMultiwordBreakpoint::VerifyBreakpointOrLocationIDs( - command, m_exe_ctx, result, &excluded_bp_ids, + command, &target, result, &excluded_bp_ids, BreakpointName::Permissions::PermissionKinds::deletePerm); if (!result.Succeeded()) return; @@ -3016,7 +3016,7 @@ class CommandObjectBreakpointNameAdd : public CommandObjectParsed { // Particular breakpoint selected; disable that breakpoint. BreakpointIDList valid_bp_ids; CommandObjectMultiwordBreakpoint::VerifyBreakpointIDs( - command, m_exe_ctx, result, &valid_bp_ids, + command, &target, result, &valid_bp_ids, BreakpointName::Permissions::PermissionKinds::listPerm); if (result.Succeeded()) { @@ -3090,7 +3090,7 @@ class CommandObjectBreakpointNameDelete : public CommandObjectParsed { // Particular breakpoint selected; disable that breakpoint. BreakpointIDList valid_bp_ids; CommandObjectMultiwordBreakpoint::VerifyBreakpointIDs( - command, m_exe_ctx, result, &valid_bp_ids, + command, &target, result, &valid_bp_ids, BreakpointName::Permissions::PermissionKinds::deletePerm); if (result.Succeeded()) { @@ -3892,7 +3892,7 @@ CommandObjectMultiwordBreakpoint::CommandObjectMultiwordBreakpoint( CommandObjectMultiwordBreakpoint::~CommandObjectMultiwordBreakpoint() = default; void CommandObjectMultiwordBreakpoint::VerifyIDs( - Args &args, ExecutionContext &exe_ctx, bool allow_locations, + Args &args, const ExecutionContext &exe_ctx, bool allow_locations, CommandReturnObject &result, BreakpointIDList *valid_ids, BreakpointName::Permissions ::PermissionKinds purpose) { // args can be strings representing 1). integers (for breakpoint ids) diff --git a/lldb/source/Commands/CommandObjectBreakpoint.h b/lldb/source/Commands/CommandObjectBreakpoint.h index 7e2fa045eb744..0213bcae9bda7 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.h +++ b/lldb/source/Commands/CommandObjectBreakpoint.h @@ -23,21 +23,21 @@ class CommandObjectMultiwordBreakpoint : public CommandObjectMultiword { ~CommandObjectMultiwordBreakpoint() override; static void VerifyBreakpointOrLocationIDs( - Args &args, ExecutionContext &exe_ctx, CommandReturnObject &result, + Args &args, const ExecutionContext &exe_ctx, CommandReturnObject &result, BreakpointIDList *valid_ids, BreakpointName::Permissions ::PermissionKinds purpose) { VerifyIDs(args, exe_ctx, true, result, valid_ids, purpose); } static void - VerifyBreakpointIDs(Args &args, ExecutionContext &exe_ctx, + VerifyBreakpointIDs(Args &args, const ExecutionContext &exe_ctx, CommandReturnObject &result, BreakpointIDList *valid_ids, BreakpointName::Permissions::PermissionKinds purpose) { VerifyIDs(args, exe_ctx, false, result, valid_ids, purpose); } private: - static void VerifyIDs(Args &args, ExecutionContext &exe_ctx, + static void VerifyIDs(Args &args, const ExecutionContext &exe_ctx, bool allow_locations, CommandReturnObject &result, BreakpointIDList *valid_ids, BreakpointName::Permissions::PermissionKinds purpose); diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp index 1ce10441e3ada..b3f528faffb8b 100644 --- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp +++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp @@ -344,7 +344,7 @@ are no syntax errors may indicate that a function was declared but never called. BreakpointIDList valid_bp_ids; CommandObjectMultiwordBreakpoint::VerifyBreakpointOrLocationIDs( - command, m_exe_ctx, result, &valid_bp_ids, + command, &target, result, &valid_bp_ids, BreakpointName::Permissions::PermissionKinds::listPerm); m_bp_options_vec.clear(); @@ -509,7 +509,7 @@ class CommandObjectBreakpointCommandDelete : public CommandObjectParsed { BreakpointIDList valid_bp_ids; CommandObjectMultiwordBreakpoint::VerifyBreakpointOrLocationIDs( - command, m_exe_ctx, result, &valid_bp_ids, + command, &target, result, &valid_bp_ids, BreakpointName::Permissions::PermissionKinds::listPerm); if (result.Succeeded()) { _______________________________________________ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
