From 86f97a417d816faaec7ecb5e4f11bbb277a1ad84 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Tue, 6 Sep 2011 19:52:49 +0000 Subject: [PATCH] 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. llvm-svn: 139163 --- lldb/tools/debugserver/source/DNB.cpp | 12 ++++++------ lldb/tools/debugserver/source/DNBBreakpoint.h | 2 +- lldb/tools/debugserver/source/DNBDefs.h | 2 ++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lldb/tools/debugserver/source/DNB.cpp b/lldb/tools/debugserver/source/DNB.cpp index a4773a573bf6..8e908b76c4d9 100644 --- a/lldb/tools/debugserver/source/DNB.cpp +++ b/lldb/tools/debugserver/source/DNB.cpp @@ -972,13 +972,13 @@ DNBWatchpointSet (nub_process_t pid, nub_addr_t addr, nub_size_t size, uint32_t { 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 @@ DNBWatchpointClear (nub_process_t pid, nub_watch_t watchID) 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 @@ DNBWatchpointGetHitCount (nub_process_t pid, nub_watch_t watchID) 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 @@ DNBWatchpointGetIgnoreCount (nub_process_t pid, nub_watch_t watchID) 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 @@ DNBWatchpointSetIgnoreCount (nub_process_t pid, nub_watch_t watchID, nub_size_t 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/lldb/tools/debugserver/source/DNBBreakpoint.h b/lldb/tools/debugserver/source/DNBBreakpoint.h index 28c967a0525e..4c2a11228b0d 100644 --- a/lldb/tools/debugserver/source/DNBBreakpoint.h +++ b/lldb/tools/debugserver/source/DNBBreakpoint.h @@ -73,7 +73,7 @@ public: } return false; } - void SetEnabled(uint32_t enabled) + void SetEnabled(bool enabled) { if (!enabled) SetHardwareIndex(INVALID_NUB_HW_INDEX); diff --git a/lldb/tools/debugserver/source/DNBDefs.h b/lldb/tools/debugserver/source/DNBDefs.h index fb259f29c7c2..4b4729307d57 100644 --- a/lldb/tools/debugserver/source/DNBDefs.h +++ b/lldb/tools/debugserver/source/DNBDefs.h @@ -66,11 +66,13 @@ typedef uint32_t nub_bool_t; #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)