aboutsummaryrefslogtreecommitdiffstats
path: root/source/Host/common/Host.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Host/common/Host.cpp')
-rw-r--r--source/Host/common/Host.cpp39
1 files changed, 18 insertions, 21 deletions
diff --git a/source/Host/common/Host.cpp b/source/Host/common/Host.cpp
index 3ba9ab7f21f3..8e210c7e5fa5 100644
--- a/source/Host/common/Host.cpp
+++ b/source/Host/common/Host.cpp
@@ -164,8 +164,7 @@ static bool CheckForMonitorCancellation() {
static thread_result_t MonitorChildProcessThreadFunction(void *arg) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
const char *function = __FUNCTION__;
- if (log)
- log->Printf("%s (arg = %p) thread starting...", function, arg);
+ LLDB_LOGF(log, "%s (arg = %p) thread starting...", function, arg);
MonitorInfo *info = (MonitorInfo *)arg;
@@ -193,9 +192,8 @@ static thread_result_t MonitorChildProcessThreadFunction(void *arg) {
while (1) {
log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS);
- if (log)
- log->Printf("%s ::waitpid (pid = %" PRIi32 ", &status, options = %i)...",
- function, pid, options);
+ LLDB_LOGF(log, "%s ::waitpid (pid = %" PRIi32 ", &status, options = %i)...",
+ function, pid, options);
if (CheckForMonitorCancellation())
break;
@@ -245,12 +243,12 @@ static thread_result_t MonitorChildProcessThreadFunction(void *arg) {
#endif
log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS);
- if (log)
- log->Printf("%s ::waitpid (pid = %" PRIi32
- ", &status, options = %i) => pid = %" PRIi32
- ", status = 0x%8.8x (%s), signal = %i, exit_state = %i",
- function, pid, options, wait_pid, status, status_cstr,
- signal, exit_status);
+ LLDB_LOGF(log,
+ "%s ::waitpid (pid = %" PRIi32
+ ", &status, options = %i) => pid = %" PRIi32
+ ", status = 0x%8.8x (%s), signal = %i, exit_state = %i",
+ function, pid, options, wait_pid, status, status_cstr, signal,
+ exit_status);
if (exited || (signal != 0 && monitor_signals)) {
bool callback_return = false;
@@ -259,18 +257,18 @@ static thread_result_t MonitorChildProcessThreadFunction(void *arg) {
// If our process exited, then this thread should exit
if (exited && wait_pid == abs(pid)) {
- if (log)
- log->Printf("%s (arg = %p) thread exiting because pid received "
- "exit signal...",
- __FUNCTION__, arg);
+ LLDB_LOGF(log,
+ "%s (arg = %p) thread exiting because pid received "
+ "exit signal...",
+ __FUNCTION__, arg);
break;
}
// If the callback returns true, it means this process should exit
if (callback_return) {
- if (log)
- log->Printf("%s (arg = %p) thread exiting because callback "
- "returned true...",
- __FUNCTION__, arg);
+ LLDB_LOGF(log,
+ "%s (arg = %p) thread exiting because callback "
+ "returned true...",
+ __FUNCTION__, arg);
break;
}
}
@@ -279,8 +277,7 @@ static thread_result_t MonitorChildProcessThreadFunction(void *arg) {
}
log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS);
- if (log)
- log->Printf("%s (arg = %p) thread exiting...", __FUNCTION__, arg);
+ LLDB_LOGF(log, "%s (arg = %p) thread exiting...", __FUNCTION__, arg);
return nullptr;
}