DNBBreakpoint::SetEnabled() should take a bool, not a uint32_t, as its input argument.
Plus for watchpoint related functions, add new macros INVALID_NUB_WATCH_ID and
NUB_WATCH_ID_IS_VALID and use them, instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@139163 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/debugserver/source/DNB.cpp b/tools/debugserver/source/DNB.cpp
index a4773a5..8e908b7 100644
--- a/tools/debugserver/source/DNB.cpp
+++ b/tools/debugserver/source/DNB.cpp
@@ -972,13 +972,13 @@
     {
         return procSP->CreateWatchpoint(addr, size, watch_flags, hardware, THREAD_NULL);
     }
-    return INVALID_NUB_BREAK_ID;
+    return INVALID_NUB_WATCH_ID;
 }
 
 nub_bool_t
 DNBWatchpointClear (nub_process_t pid, nub_watch_t watchID)
 {
-    if (NUB_BREAK_ID_IS_VALID(watchID))
+    if (NUB_WATCH_ID_IS_VALID(watchID))
     {
         MachProcessSP procSP;
         if (GetProcessSP (pid, procSP))
@@ -992,7 +992,7 @@
 nub_ssize_t
 DNBWatchpointGetHitCount (nub_process_t pid, nub_watch_t watchID)
 {
-    if (NUB_BREAK_ID_IS_VALID(watchID))
+    if (NUB_WATCH_ID_IS_VALID(watchID))
     {
         MachProcessSP procSP;
         if (GetProcessSP (pid, procSP))
@@ -1008,7 +1008,7 @@
 nub_ssize_t
 DNBWatchpointGetIgnoreCount (nub_process_t pid, nub_watch_t watchID)
 {
-    if (NUB_BREAK_ID_IS_VALID(watchID))
+    if (NUB_WATCH_ID_IS_VALID(watchID))
     {
         MachProcessSP procSP;
         if (GetProcessSP (pid, procSP))
@@ -1024,7 +1024,7 @@
 nub_bool_t
 DNBWatchpointSetIgnoreCount (nub_process_t pid, nub_watch_t watchID, nub_size_t ignore_count)
 {
-    if (NUB_BREAK_ID_IS_VALID(watchID))
+    if (NUB_WATCH_ID_IS_VALID(watchID))
     {
         MachProcessSP procSP;
         if (GetProcessSP (pid, procSP))
@@ -1047,7 +1047,7 @@
 nub_bool_t
 DNBWatchpointSetCallback (nub_process_t pid, nub_watch_t watchID, DNBCallbackBreakpointHit callback, void *baton)
 {
-    if (NUB_BREAK_ID_IS_VALID(watchID))
+    if (NUB_WATCH_ID_IS_VALID(watchID))
     {
         MachProcessSP procSP;
         if (GetProcessSP (pid, procSP))
diff --git a/tools/debugserver/source/DNBBreakpoint.h b/tools/debugserver/source/DNBBreakpoint.h
index 28c967a..4c2a112 100644
--- a/tools/debugserver/source/DNBBreakpoint.h
+++ b/tools/debugserver/source/DNBBreakpoint.h
@@ -73,7 +73,7 @@
                     }
                     return false;
                 }
-    void        SetEnabled(uint32_t enabled)
+    void        SetEnabled(bool enabled)
                 {
                     if (!enabled)
                         SetHardwareIndex(INVALID_NUB_HW_INDEX);
diff --git a/tools/debugserver/source/DNBDefs.h b/tools/debugserver/source/DNBDefs.h
index fb259f2..4b47293 100644
--- a/tools/debugserver/source/DNBDefs.h
+++ b/tools/debugserver/source/DNBDefs.h
@@ -66,11 +66,13 @@
 #define INVALID_NUB_BREAK_ID    ((nub_break_t)0)
 #define INVALID_NUB_PROCESS     ((nub_process_t)0)
 #define INVALID_NUB_THREAD      ((nub_thread_t)0)
+#define INVALID_NUB_WATCH_ID    ((nub_watch_t)0)
 #define INVALID_NUB_HW_INDEX    UINT32_MAX
 #define INVALID_NUB_REGNUM      UINT32_MAX
 #define NUB_GENERIC_ERROR       UINT32_MAX
 
 #define NUB_BREAK_ID_IS_VALID(breakID)    ((breakID) != (INVALID_NUB_BREAK_ID))
+#define NUB_WATCH_ID_IS_VALID(watchID)    ((watchID) != (INVALID_NUB_WATCH_ID))
 
 // Watchpoint types
 #define WATCH_TYPE_READ     (1u << 0)