aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2024-07-31 11:02:18 -0700
committerJonas Devlieghere <jonas@devlieghere.com>2024-07-31 18:06:32 -0700
commit5dbbc3b14bb04ef4bf2cbf4c23008f94f4253704 (patch)
treea06ba2f4649c09dc059c4d0b09d14ef5c426a5e4 /lldb/source/Commands/CommandObjectBreakpointCommand.cpp
parent1c5f6cfc352c3bd2a4faa0e3aebb4028b557a5e7 (diff)
downloadllvm-5dbbc3b14bb04ef4bf2cbf4c23008f94f4253704.zip
llvm-5dbbc3b14bb04ef4bf2cbf4c23008f94f4253704.tar.gz
llvm-5dbbc3b14bb04ef4bf2cbf4c23008f94f4253704.tar.bz2
[lldb] Use Target references instead of pointers in CommandObject (NFC)
The GetTarget helper returns a Target reference so there's reason to convert it to a pointer and check its validity.
Diffstat (limited to 'lldb/source/Commands/CommandObjectBreakpointCommand.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectBreakpointCommand.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
index 5d95c2a..8c1fb51 100644
--- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
@@ -548,9 +548,9 @@ public:
protected:
void DoExecute(Args &command, CommandReturnObject &result) override {
- Target *target = &GetTarget();
+ Target &target = GetTarget();
- const BreakpointList &breakpoints = target->GetBreakpointList();
+ const BreakpointList &breakpoints = target.GetBreakpointList();
size_t num_breakpoints = breakpoints.GetSize();
if (num_breakpoints == 0) {
@@ -566,7 +566,7 @@ protected:
BreakpointIDList valid_bp_ids;
CommandObjectMultiwordBreakpoint::VerifyBreakpointOrLocationIDs(
- command, target, result, &valid_bp_ids,
+ command, &target, result, &valid_bp_ids,
BreakpointName::Permissions::PermissionKinds::listPerm);
if (result.Succeeded()) {
@@ -575,7 +575,7 @@ protected:
BreakpointID cur_bp_id = valid_bp_ids.GetBreakpointIDAtIndex(i);
if (cur_bp_id.GetBreakpointID() != LLDB_INVALID_BREAK_ID) {
Breakpoint *bp =
- target->GetBreakpointByID(cur_bp_id.GetBreakpointID()).get();
+ target.GetBreakpointByID(cur_bp_id.GetBreakpointID()).get();
if (bp) {
BreakpointLocationSP bp_loc_sp;