summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/tools/debugserver')
-rw-r--r--lldb/tools/debugserver/source/JSONGenerator.h4
-rw-r--r--lldb/tools/debugserver/source/MacOSX/Genealogy.cpp3
-rw-r--r--lldb/tools/debugserver/source/MacOSX/MachProcess.mm12
-rw-r--r--lldb/tools/debugserver/source/MacOSX/MachThread.cpp4
-rw-r--r--lldb/tools/debugserver/source/MacOSX/MachVMRegion.cpp5
-rw-r--r--lldb/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp7
-rw-r--r--lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp7
-rw-r--r--lldb/tools/debugserver/source/RNBRemote.cpp11
-rw-r--r--lldb/tools/debugserver/source/RNBServices.cpp6
-rw-r--r--lldb/tools/debugserver/source/libdebugserver.cpp2
10 files changed, 24 insertions, 37 deletions
diff --git a/lldb/tools/debugserver/source/JSONGenerator.h b/lldb/tools/debugserver/source/JSONGenerator.h
index 6c6a6253df0..0ac5e0bb768 100644
--- a/lldb/tools/debugserver/source/JSONGenerator.h
+++ b/lldb/tools/debugserver/source/JSONGenerator.h
@@ -182,7 +182,7 @@ public:
void SetValue(bool value) { m_value = value; }
void Dump(std::ostream &s) const override {
- if (m_value == true)
+ if (m_value)
s << "true";
else
s << "false";
@@ -262,7 +262,7 @@ public:
s << "{";
for (collection::const_iterator iter = m_dict.begin();
iter != m_dict.end(); ++iter) {
- if (have_printed_one_elem == false) {
+ if (!have_printed_one_elem) {
have_printed_one_elem = true;
} else {
s << ",";
diff --git a/lldb/tools/debugserver/source/MacOSX/Genealogy.cpp b/lldb/tools/debugserver/source/MacOSX/Genealogy.cpp
index 22ff52abaa4..1473a53fcbe 100644
--- a/lldb/tools/debugserver/source/MacOSX/Genealogy.cpp
+++ b/lldb/tools/debugserver/source/MacOSX/Genealogy.cpp
@@ -74,8 +74,7 @@ Genealogy::GetGenealogyInfoForThread(pid_t pid, nub_thread_t tid,
// (else we'll need to hit the timeout for every thread we're asked about.)
// We'll try again at the next public stop.
- if (m_thread_activities.size() == 0 &&
- m_diagnosticd_call_timed_out == false) {
+ if (m_thread_activities.size() == 0 && !m_diagnosticd_call_timed_out) {
GetActivities(pid, thread_list, task);
}
std::map<nub_thread_t, ThreadActivitySP>::const_iterator search;
diff --git a/lldb/tools/debugserver/source/MacOSX/MachProcess.mm b/lldb/tools/debugserver/source/MacOSX/MachProcess.mm
index edbd012e6e2..a3b905d0515 100644
--- a/lldb/tools/debugserver/source/MacOSX/MachProcess.mm
+++ b/lldb/tools/debugserver/source/MacOSX/MachProcess.mm
@@ -783,8 +783,8 @@ JSONGenerator::ObjectSP MachProcess::FormatDynamicLibrariesIntoJSON(
uuid_unparse_upper(image_infos[i].macho_info.uuid, uuidstr);
image_info_dict_sp->AddStringItem("uuid", uuidstr);
- if (image_infos[i].macho_info.min_version_os_name.empty() == false &&
- image_infos[i].macho_info.min_version_os_version.empty() == false) {
+ if (!image_infos[i].macho_info.min_version_os_name.empty() &&
+ !image_infos[i].macho_info.min_version_os_version.empty()) {
image_info_dict_sp->AddStringItem(
"min_version_os_name", image_infos[i].macho_info.min_version_os_name);
image_info_dict_sp->AddStringItem(
@@ -1602,7 +1602,7 @@ nub_size_t MachProcess::WriteMemory(nub_addr_t addr, nub_size_t size,
void MachProcess::ReplyToAllExceptions() {
PTHREAD_MUTEX_LOCKER(locker, m_exception_messages_mutex);
- if (m_exception_messages.empty() == false) {
+ if (!m_exception_messages.empty()) {
MachException::Message::iterator pos;
MachException::Message::iterator begin = m_exception_messages.begin();
MachException::Message::iterator end = m_exception_messages.end();
@@ -1774,7 +1774,7 @@ bool MachProcess::DisableBreakpoint(nub_addr_t addr, bool remove) {
if (bp->IsHardware()) {
bool hw_disable_result = m_thread_list.DisableHardwareBreakpoint(bp);
- if (hw_disable_result == true) {
+ if (hw_disable_result) {
bp->SetEnabled(false);
// Let the thread list know that a breakpoint has been modified
if (remove) {
@@ -1909,7 +1909,7 @@ bool MachProcess::DisableWatchpoint(nub_addr_t addr, bool remove) {
if (wp->IsHardware()) {
bool hw_disable_result = m_thread_list.DisableHardwareWatchpoint(wp);
- if (hw_disable_result == true) {
+ if (hw_disable_result) {
wp->SetEnabled(false);
if (remove)
m_watchpoints.Remove(addr);
@@ -2179,7 +2179,7 @@ task_t MachProcess::ExceptionMessageBundleComplete() {
m_thread_list.Dump();
bool step_more = false;
- if (m_thread_list.ShouldStop(step_more) && auto_resume == false) {
+ if (m_thread_list.ShouldStop(step_more) && !auto_resume) {
// Wait for the eEventProcessRunningStateChanged event to be reset
// before changing state to stopped to avoid race condition with
// very fast start/stops
diff --git a/lldb/tools/debugserver/source/MacOSX/MachThread.cpp b/lldb/tools/debugserver/source/MacOSX/MachThread.cpp
index fc97825786a..062e1c3d9ed 100644
--- a/lldb/tools/debugserver/source/MacOSX/MachThread.cpp
+++ b/lldb/tools/debugserver/source/MacOSX/MachThread.cpp
@@ -83,7 +83,7 @@ bool MachThread::SetSuspendCountBeforeResume(bool others_stopped) {
DNBLogThreadedIf(LOG_THREAD | LOG_VERBOSE, "MachThread::%s ( )",
__FUNCTION__);
DNBError err;
- if (MachPortNumberIsValid(m_mach_port_number) == false)
+ if (!MachPortNumberIsValid(m_mach_port_number))
return false;
integer_t times_to_resume;
@@ -121,7 +121,7 @@ bool MachThread::RestoreSuspendCountAfterStop() {
DNBLogThreadedIf(LOG_THREAD | LOG_VERBOSE, "MachThread::%s ( )",
__FUNCTION__);
DNBError err;
- if (MachPortNumberIsValid(m_mach_port_number) == false)
+ if (!MachPortNumberIsValid(m_mach_port_number))
return false;
if (m_suspend_count > 0) {
diff --git a/lldb/tools/debugserver/source/MacOSX/MachVMRegion.cpp b/lldb/tools/debugserver/source/MacOSX/MachVMRegion.cpp
index c011c133ac3..172fc7867b5 100644
--- a/lldb/tools/debugserver/source/MacOSX/MachVMRegion.cpp
+++ b/lldb/tools/debugserver/source/MacOSX/MachVMRegion.cpp
@@ -166,10 +166,7 @@ bool MachVMRegion::GetRegionForAddress(nub_addr_t addr) {
// doesn't mean that "addr" is in the range. The data in this object will
// be valid though, so you could see where the next region begins. So we
// return false, yet leave "m_err" with a successfull return code.
- if ((addr < m_start) || (addr >= (m_start + m_size)))
- return false;
-
- return true;
+ return !((addr < m_start) || (addr >= (m_start + m_size)));
}
uint32_t MachVMRegion::GetDNBPermissions() const {
diff --git a/lldb/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp b/lldb/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
index adcd6500219..ba37a328ecf 100644
--- a/lldb/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
+++ b/lldb/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
@@ -889,10 +889,7 @@ bool DNBArchImplI386::RollbackTransForHWP() {
LOG_WATCHPOINTS,
"DNBArchImplI386::RollbackTransForHWP() SetDBGState() => 0x%8.8x.", kret);
- if (kret == KERN_SUCCESS)
- return true;
- else
- return false;
+ return kret == KERN_SUCCESS;
}
bool DNBArchImplI386::FinishTransForHWP() {
m_2pc_trans_state = Trans_Done;
@@ -918,7 +915,7 @@ uint32_t DNBArchImplI386::EnableHardwareWatchpoint(nub_addr_t addr,
return INVALID_NUB_HW_INDEX;
// We must watch for either read or write
- if (read == false && write == false)
+ if (!read && !write)
return INVALID_NUB_HW_INDEX;
// Read the debug state
diff --git a/lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp b/lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
index f0a3d2b001b..2f8ed32fa5d 100644
--- a/lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
+++ b/lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
@@ -844,10 +844,7 @@ bool DNBArchImplX86_64::RollbackTransForHWP() {
"DNBArchImplX86_64::RollbackTransForHWP() SetDBGState() => 0x%8.8x.",
kret);
- if (kret == KERN_SUCCESS)
- return true;
- else
- return false;
+ return kret == KERN_SUCCESS;
}
bool DNBArchImplX86_64::FinishTransForHWP() {
m_2pc_trans_state = Trans_Done;
@@ -873,7 +870,7 @@ uint32_t DNBArchImplX86_64::EnableHardwareWatchpoint(nub_addr_t addr,
return INVALID_NUB_HW_INDEX;
// We must watch for either read or write
- if (read == false && write == false)
+ if (!read && !write)
return INVALID_NUB_HW_INDEX;
// Read the debug state
diff --git a/lldb/tools/debugserver/source/RNBRemote.cpp b/lldb/tools/debugserver/source/RNBRemote.cpp
index bfcd799f131..c8ef153fcb4 100644
--- a/lldb/tools/debugserver/source/RNBRemote.cpp
+++ b/lldb/tools/debugserver/source/RNBRemote.cpp
@@ -3413,10 +3413,7 @@ static bool RNBRemoteShouldCancelCallback(void *not_used) {
RNBRemoteSP remoteSP(g_remoteSP);
if (remoteSP.get() != NULL) {
RNBRemote *remote = remoteSP.get();
- if (remote->Comm().IsConnected())
- return false;
- else
- return true;
+ return !remote->Comm().IsConnected();
}
return true;
}
@@ -3817,7 +3814,7 @@ rnb_err_t RNBRemote::HandlePacket_v(const char *p) {
attach_failed_due_to_sip = true;
}
- if (attach_failed_due_to_sip == false) {
+ if (!attach_failed_due_to_sip) {
int csops_flags = 0;
int retval = ::csops(pid_attaching_to, CS_OPS_STATUS, &csops_flags,
sizeof(csops_flags));
@@ -5300,7 +5297,7 @@ RNBRemote::GetJSONThreadsInfo(bool threads_with_valid_stop_info_only) {
thread_dict_sp->AddStringItem("reason", reason_value);
- if (threads_with_valid_stop_info_only == false) {
+ if (!threads_with_valid_stop_info_only) {
const char *thread_name = DNBThreadGetName(pid, tid);
if (thread_name && thread_name[0])
thread_dict_sp->AddStringItem("name", thread_name);
@@ -5488,7 +5485,7 @@ rnb_err_t RNBRemote::HandlePacket_jThreadExtendedInfo(const char *p) {
bool need_to_print_comma = false;
- if (thread_activity_sp && timed_out == false) {
+ if (thread_activity_sp && !timed_out) {
const Genealogy::Activity *activity =
&thread_activity_sp->current_activity;
bool need_vouchers_comma_sep = false;
diff --git a/lldb/tools/debugserver/source/RNBServices.cpp b/lldb/tools/debugserver/source/RNBServices.cpp
index b2f4910f885..89c4c27da1d 100644
--- a/lldb/tools/debugserver/source/RNBServices.cpp
+++ b/lldb/tools/debugserver/source/RNBServices.cpp
@@ -57,9 +57,9 @@ int GetProcesses(CFMutableArrayRef plistMutableArray, bool all_users) {
const pid_t pid = proc_info.kp_proc.p_pid;
// Skip zombie processes and processes with unset status
- if (kinfo_user_matches == false || // User is acceptable
- pid == our_pid || // Skip this process
- pid == 0 || // Skip kernel (kernel pid is zero)
+ if (!kinfo_user_matches || // User is acceptable
+ pid == our_pid || // Skip this process
+ pid == 0 || // Skip kernel (kernel pid is zero)
proc_info.kp_proc.p_stat ==
SZOMB || // Zombies are bad, they like brains...
proc_info.kp_proc.p_flag & P_TRACED || // Being debugged?
diff --git a/lldb/tools/debugserver/source/libdebugserver.cpp b/lldb/tools/debugserver/source/libdebugserver.cpp
index 0d27cfd89a3..34df67521a7 100644
--- a/lldb/tools/debugserver/source/libdebugserver.cpp
+++ b/lldb/tools/debugserver/source/libdebugserver.cpp
@@ -176,7 +176,7 @@ RNBRunLoopMode HandleProcessStateChange(RNBRemoteSP &remote, bool initialize) {
case eStateSuspended:
case eStateCrashed:
case eStateStopped:
- if (initialize == false) {
+ if (!initialize) {
// Compare the last stop count to our current notion of a stop count
// to make sure we don't notify more than once for a given stop.
nub_size_t prev_pid_stop_count = ctx.GetProcessStopCount();
OpenPOWER on IntegriCloud