Skip to content

[lldb] [NFC] Remove unused WatchpointResource::SetID method #79389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

jasonmolenda
Copy link
Collaborator

I originally thought to try to guesstimate the hardware watchpoint index number that a Resource was associated with, but gdb remote serial protocol doesn't give us the hardware register index used so it was only a guess. I changed my mind and simply use ever-incrementing ID numbers for the WatchpointResources, but forgot to remove the SetID method.

I originally thought to try to guesstimate the hardware watchpoint
index number that a Resource was associated with, but gdb remote
serial protocol doesn't give us the hardware register index used
so it was only a guess.  I changed my mind and simply use
ever-incrementing ID numbers for the WatchpointResources, but forgot
to remove the SetID method.
@llvmbot
Copy link
Member

llvmbot commented Jan 24, 2024

@llvm/pr-subscribers-lldb

Author: Jason Molenda (jasonmolenda)

Changes

I originally thought to try to guesstimate the hardware watchpoint index number that a Resource was associated with, but gdb remote serial protocol doesn't give us the hardware register index used so it was only a guess. I changed my mind and simply use ever-incrementing ID numbers for the WatchpointResources, but forgot to remove the SetID method.


Full diff: https://github.com/llvm/llvm-project/pull/79389.diff

2 Files Affected:

  • (modified) lldb/include/lldb/Breakpoint/WatchpointResource.h (-8)
  • (modified) lldb/source/Breakpoint/WatchpointResource.cpp (-2)
diff --git a/lldb/include/lldb/Breakpoint/WatchpointResource.h b/lldb/include/lldb/Breakpoint/WatchpointResource.h
index 4b1d733850f1bbf..070d84cff8f26fe 100644
--- a/lldb/include/lldb/Breakpoint/WatchpointResource.h
+++ b/lldb/include/lldb/Breakpoint/WatchpointResource.h
@@ -121,14 +121,6 @@ class WatchpointResource
   ///    A copy of the Watchpoints which own this resource.
   WatchpointCollection CopyConstituentsList();
 
-  // The ID of the WatchpointResource is set by the WatchpointResourceList
-  // when the Resource has been set in the inferior and is being added
-  // to the List, in an attempt to match the hardware watchpoint register
-  // ordering.  If a Process can correctly identify the hardware watchpoint
-  // register index when it has created the Resource, it may initialize it
-  // before it is inserted in the WatchpointResourceList.
-  void SetID(lldb::wp_resource_id_t);
-
   lldb::wp_resource_id_t GetID() const;
 
   bool Contains(lldb::addr_t addr);
diff --git a/lldb/source/Breakpoint/WatchpointResource.cpp b/lldb/source/Breakpoint/WatchpointResource.cpp
index d0f8dc346f3c024..c1eb50c0358b30e 100644
--- a/lldb/source/Breakpoint/WatchpointResource.cpp
+++ b/lldb/source/Breakpoint/WatchpointResource.cpp
@@ -42,8 +42,6 @@ void WatchpointResource::SetType(bool read, bool write) {
 
 wp_resource_id_t WatchpointResource::GetID() const { return m_id; }
 
-void WatchpointResource::SetID(wp_resource_id_t id) { m_id = id; }
-
 bool WatchpointResource::Contains(addr_t addr) {
   if (addr >= m_addr && addr < m_addr + m_size)
     return true;

Copy link
Member

@bulbazord bulbazord left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jasonmolenda jasonmolenda merged commit 56da799 into llvm:main Jan 24, 2024
@jasonmolenda jasonmolenda deleted the remove-watchpointresource-setid-method-retry branch January 24, 2024 23:18
jasonmolenda added a commit to jasonmolenda/llvm-project that referenced this pull request Feb 1, 2024
I originally thought to try to guesstimate the hardware watchpoint index
number that a Resource was associated with, but gdb remote serial
protocol doesn't give us the hardware register index used so it was only
a guess. I changed my mind and simply use ever-incrementing ID numbers
for the WatchpointResources, but forgot to remove the SetID method.

(cherry picked from commit 56da799)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants