diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2024-07-31 11:02:18 -0700 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2024-07-31 18:06:32 -0700 |
commit | 5dbbc3b14bb04ef4bf2cbf4c23008f94f4253704 (patch) | |
tree | a06ba2f4649c09dc059c4d0b09d14ef5c426a5e4 /lldb/source/Commands/CommandObjectWatchpointCommand.cpp | |
parent | 1c5f6cfc352c3bd2a4faa0e3aebb4028b557a5e7 (diff) | |
download | llvm-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/CommandObjectWatchpointCommand.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectWatchpointCommand.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lldb/source/Commands/CommandObjectWatchpointCommand.cpp b/lldb/source/Commands/CommandObjectWatchpointCommand.cpp index b4743eb..cc4cb76 100644 --- a/lldb/source/Commands/CommandObjectWatchpointCommand.cpp +++ b/lldb/source/Commands/CommandObjectWatchpointCommand.cpp @@ -355,9 +355,9 @@ are no syntax errors may indicate that a function was declared but never called. protected: void DoExecute(Args &command, CommandReturnObject &result) override { - Target *target = &GetTarget(); + Target &target = GetTarget(); - const WatchpointList &watchpoints = target->GetWatchpointList(); + const WatchpointList &watchpoints = target.GetWatchpointList(); size_t num_watchpoints = watchpoints.GetSize(); if (num_watchpoints == 0) { @@ -384,7 +384,7 @@ protected: 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) { - Watchpoint *wp = target->GetWatchpointList().FindByID(cur_wp_id).get(); + Watchpoint *wp = target.GetWatchpointList().FindByID(cur_wp_id).get(); // Sanity check wp first. if (wp == nullptr) continue; @@ -450,9 +450,9 @@ public: protected: void DoExecute(Args &command, CommandReturnObject &result) override { - Target *target = &GetTarget(); + Target &target = GetTarget(); - const WatchpointList &watchpoints = target->GetWatchpointList(); + const WatchpointList &watchpoints = target.GetWatchpointList(); size_t num_watchpoints = watchpoints.GetSize(); if (num_watchpoints == 0) { @@ -478,7 +478,7 @@ protected: 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) { - Watchpoint *wp = target->GetWatchpointList().FindByID(cur_wp_id).get(); + Watchpoint *wp = target.GetWatchpointList().FindByID(cur_wp_id).get(); if (wp) wp->ClearCallback(); } else { @@ -505,9 +505,9 @@ public: protected: void DoExecute(Args &command, CommandReturnObject &result) override { - Target *target = &GetTarget(); + Target &target = GetTarget(); - const WatchpointList &watchpoints = target->GetWatchpointList(); + const WatchpointList &watchpoints = target.GetWatchpointList(); size_t num_watchpoints = watchpoints.GetSize(); if (num_watchpoints == 0) { @@ -533,7 +533,7 @@ protected: 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) { - Watchpoint *wp = target->GetWatchpointList().FindByID(cur_wp_id).get(); + Watchpoint *wp = target.GetWatchpointList().FindByID(cur_wp_id).get(); if (wp) { const WatchpointOptions *wp_options = wp->GetOptions(); |