aboutsummaryrefslogtreecommitdiffstats
path: root/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp')
-rw-r--r--source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp60
1 files changed, 27 insertions, 33 deletions
diff --git a/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp b/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
index 770794569f72..32e3320150f8 100644
--- a/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
+++ b/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
@@ -154,9 +154,8 @@ Status ProcessFreeBSD::DoResume() {
do_step = true;
}
- if (log)
- log->Printf("process %" PRIu64 " resuming (%s)", GetID(),
- do_step ? "step" : "continue");
+ LLDB_LOGF(log, "process %" PRIu64 " resuming (%s)", GetID(),
+ do_step ? "step" : "continue");
if (do_step && !software_single_step)
m_monitor->SingleStep(GetID(), m_resume_signo);
else
@@ -168,9 +167,8 @@ Status ProcessFreeBSD::DoResume() {
bool ProcessFreeBSD::UpdateThreadList(ThreadList &old_thread_list,
ThreadList &new_thread_list) {
Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PROCESS));
- if (log)
- log->Printf("ProcessFreeBSD::%s (pid = %" PRIu64 ")", __FUNCTION__,
- GetID());
+ LLDB_LOGF(log, "ProcessFreeBSD::%s (pid = %" PRIu64 ")", __FUNCTION__,
+ GetID());
std::vector<lldb::pid_t> tds;
if (!GetMonitor().GetCurrentThreadIDs(tds)) {
@@ -183,20 +181,18 @@ bool ProcessFreeBSD::UpdateThreadList(ThreadList &old_thread_list,
ThreadSP thread_sp(old_thread_list_copy.RemoveThreadByID(tid, false));
if (!thread_sp) {
thread_sp.reset(new FreeBSDThread(*this, tid));
- if (log)
- log->Printf("ProcessFreeBSD::%s new tid = %" PRIu64, __FUNCTION__, tid);
+ LLDB_LOGF(log, "ProcessFreeBSD::%s new tid = %" PRIu64, __FUNCTION__,
+ tid);
} else {
- if (log)
- log->Printf("ProcessFreeBSD::%s existing tid = %" PRIu64, __FUNCTION__,
- tid);
+ LLDB_LOGF(log, "ProcessFreeBSD::%s existing tid = %" PRIu64, __FUNCTION__,
+ tid);
}
new_thread_list.AddThread(thread_sp);
}
for (size_t i = 0; i < old_thread_list_copy.GetSize(false); ++i) {
ThreadSP old_thread_sp(old_thread_list_copy.GetThreadAtIndex(i, false));
if (old_thread_sp) {
- if (log)
- log->Printf("ProcessFreeBSD::%s remove tid", __FUNCTION__);
+ LLDB_LOGF(log, "ProcessFreeBSD::%s remove tid", __FUNCTION__);
}
}
@@ -698,14 +694,13 @@ Status ProcessFreeBSD::EnableWatchpoint(Watchpoint *wp, bool notify) {
user_id_t watchID = wp->GetID();
addr_t addr = wp->GetLoadAddress();
Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_WATCHPOINTS));
- if (log)
- log->Printf("ProcessFreeBSD::EnableWatchpoint(watchID = %" PRIu64 ")",
- watchID);
+ LLDB_LOGF(log, "ProcessFreeBSD::EnableWatchpoint(watchID = %" PRIu64 ")",
+ watchID);
if (wp->IsEnabled()) {
- if (log)
- log->Printf("ProcessFreeBSD::EnableWatchpoint(watchID = %" PRIu64
- ") addr = 0x%8.8" PRIx64 ": watchpoint already enabled.",
- watchID, (uint64_t)addr);
+ LLDB_LOGF(log,
+ "ProcessFreeBSD::EnableWatchpoint(watchID = %" PRIu64
+ ") addr = 0x%8.8" PRIx64 ": watchpoint already enabled.",
+ watchID, (uint64_t)addr);
return error;
}
@@ -753,14 +748,13 @@ Status ProcessFreeBSD::DisableWatchpoint(Watchpoint *wp, bool notify) {
user_id_t watchID = wp->GetID();
addr_t addr = wp->GetLoadAddress();
Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_WATCHPOINTS));
- if (log)
- log->Printf("ProcessFreeBSD::DisableWatchpoint(watchID = %" PRIu64 ")",
- watchID);
+ LLDB_LOGF(log, "ProcessFreeBSD::DisableWatchpoint(watchID = %" PRIu64 ")",
+ watchID);
if (!wp->IsEnabled()) {
- if (log)
- log->Printf("ProcessFreeBSD::DisableWatchpoint(watchID = %" PRIu64
- ") addr = 0x%8.8" PRIx64 ": watchpoint already disabled.",
- watchID, (uint64_t)addr);
+ LLDB_LOGF(log,
+ "ProcessFreeBSD::DisableWatchpoint(watchID = %" PRIu64
+ ") addr = 0x%8.8" PRIx64 ": watchpoint already disabled.",
+ watchID, (uint64_t)addr);
// This is needed (for now) to keep watchpoints disabled correctly
wp->SetEnabled(false, notify);
return error;
@@ -970,8 +964,9 @@ Status ProcessFreeBSD::SetSoftwareSingleStepBreakpoint(lldb::tid_t tid,
Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PROCESS));
if (log) {
- log->Printf("ProcessFreeBSD::%s addr = 0x%" PRIx64, __FUNCTION__, addr);
- log->Printf("SoftwareBreakpoint::%s addr = 0x%" PRIx64, __FUNCTION__, addr);
+ LLDB_LOGF(log, "ProcessFreeBSD::%s addr = 0x%" PRIx64, __FUNCTION__, addr);
+ LLDB_LOGF(log, "SoftwareBreakpoint::%s addr = 0x%" PRIx64, __FUNCTION__,
+ addr);
}
// Validate the address.
@@ -982,11 +977,10 @@ Status ProcessFreeBSD::SetSoftwareSingleStepBreakpoint(lldb::tid_t tid,
Breakpoint *const sw_step_break =
m_process->GetTarget().CreateBreakpoint(addr, true, false).get();
sw_step_break->SetCallback(SingleStepBreakpointHit, this, true);
- sw_step_break->SetBreakpointKind("software-signle-step");
+ sw_step_break->SetBreakpointKind("software-single-step");
- if (log)
- log->Printf("ProcessFreeBSD::%s addr = 0x%" PRIx64 " -- SUCCESS",
- __FUNCTION__, addr);
+ LLDB_LOGF(log, "ProcessFreeBSD::%s addr = 0x%" PRIx64 " -- SUCCESS",
+ __FUNCTION__, addr);
m_threads_stepping_with_breakpoint.insert({tid, sw_step_break->GetID()});
return Status();