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
This commit is contained in:
Johnny Chen 2011-09-06 19:52:49 +00:00
parent fed48af3de
commit 86f97a417d
3 changed files with 9 additions and 7 deletions

View File

@ -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))

View File

@ -73,7 +73,7 @@ public:
}
return false;
}
void SetEnabled(uint32_t enabled)
void SetEnabled(bool enabled)
{
if (!enabled)
SetHardwareIndex(INVALID_NUB_HW_INDEX);

View File

@ -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)