[Lldb-commits] [lldb] Remove hardware index from watchpoints and breakpoints (PR #72012)

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Sat Nov 11 10:16:44 PST 2023


================
@@ -94,16 +94,11 @@ SBError SBWatchpoint::GetError() {
 int32_t SBWatchpoint::GetHardwareIndex() {
   LLDB_INSTRUMENT_VA(this);
 
-  int32_t hw_index = -1;
-
-  lldb::WatchpointSP watchpoint_sp(GetSP());
-  if (watchpoint_sp) {
-    std::lock_guard<std::recursive_mutex> guard(
-        watchpoint_sp->GetTarget().GetAPIMutex());
-    hw_index = watchpoint_sp->GetHardwareIndex();
-  }
-
-  return hw_index;
+  // For processes using gdb remote protocol,
+  // we cannot determine the hardware breakpoint
+  // index reliably; providing possibly correct
+  // guesses is not useful to anyone.
+  return UINT32_MAX;
----------------
bulbazord wrote:

Instead of returning `UINT32_MAX`, can you return `-1` directly? To make it more clear.

https://github.com/llvm/llvm-project/pull/72012


More information about the lldb-commits mailing list