forked from OSchip/llvm-project
Enabled the "printf" attribute on all debugserver logging functions and fixed
the ensuing mayhem. llvm-svn: 143244
This commit is contained in:
parent
a109e00bba
commit
490fbbe270
|
@ -286,7 +286,7 @@ DNBProcessAttachByName (const char *name, struct timespec *timeout, char *err_st
|
|||
}
|
||||
else if (num_matching_proc_infos > 1)
|
||||
{
|
||||
DNBLogError ("error: %u processes match '%s':\n", num_matching_proc_infos, name);
|
||||
DNBLogError ("error: %zu processes match '%s':\n", num_matching_proc_infos, name);
|
||||
size_t i;
|
||||
for (i=0; i<num_matching_proc_infos; ++i)
|
||||
DNBLogError ("%6u - %s\n", matching_proc_infos[i].kp_proc.p_pid, matching_proc_infos[i].kp_proc.p_comm);
|
||||
|
|
|
@ -77,34 +77,34 @@ DNBBreakpoint::Dump() const
|
|||
{
|
||||
if (IsBreakpoint())
|
||||
{
|
||||
DNBLog("DNBBreakpoint %u: tid = %4.4x addr = %8.8p state = %s type = %s breakpoint hw_index = %i hit_count = %-4u ignore_count = %-4u callback = %8.8p baton = %8.8p",
|
||||
m_breakID,
|
||||
m_tid,
|
||||
m_addr,
|
||||
m_enabled ? "enabled " : "disabled",
|
||||
IsHardware() ? "hardware" : "software",
|
||||
GetHardwareIndex(),
|
||||
GetHitCount(),
|
||||
GetIgnoreCount(),
|
||||
m_callback,
|
||||
m_callback_baton);
|
||||
DNBLog ("DNBBreakpoint %u: tid = %4.4x addr = 0x%llx state = %s type = %s breakpoint hw_index = %i hit_count = %-4u ignore_count = %-4u callback = %p baton = %p",
|
||||
m_breakID,
|
||||
m_tid,
|
||||
(uint64_t)m_addr,
|
||||
m_enabled ? "enabled " : "disabled",
|
||||
IsHardware() ? "hardware" : "software",
|
||||
GetHardwareIndex(),
|
||||
GetHitCount(),
|
||||
GetIgnoreCount(),
|
||||
m_callback,
|
||||
m_callback_baton);
|
||||
}
|
||||
else
|
||||
{
|
||||
DNBLog("DNBBreakpoint %u: tid = %4.4x addr = %8.8p size = %u state = %s type = %s watchpoint (%s%s) hw_index = %i hit_count = %-4u ignore_count = %-4u callback = %8.8p baton = %8.8p",
|
||||
m_breakID,
|
||||
m_tid,
|
||||
m_addr,
|
||||
m_byte_size,
|
||||
m_enabled ? "enabled " : "disabled",
|
||||
IsHardware() ? "hardware" : "software",
|
||||
m_watch_read ? "r" : "",
|
||||
m_watch_write ? "w" : "",
|
||||
GetHardwareIndex(),
|
||||
GetHitCount(),
|
||||
GetIgnoreCount(),
|
||||
m_callback,
|
||||
m_callback_baton);
|
||||
DNBLog ("DNBBreakpoint %u: tid = %4.4x addr = 0x%llx size = %zu state = %s type = %s watchpoint (%s%s) hw_index = %i hit_count = %-4u ignore_count = %-4u callback = %p baton = %p",
|
||||
m_breakID,
|
||||
m_tid,
|
||||
(uint64_t)m_addr,
|
||||
m_byte_size,
|
||||
m_enabled ? "enabled " : "disabled",
|
||||
IsHardware() ? "hardware" : "software",
|
||||
m_watch_read ? "r" : "",
|
||||
m_watch_write ? "w" : "",
|
||||
GetHardwareIndex(),
|
||||
GetHitCount(),
|
||||
GetIgnoreCount(),
|
||||
m_callback,
|
||||
m_callback_baton);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -185,7 +185,7 @@ _DNBLogThreaded (const char *format, ...)
|
|||
timersub (&tv, &g_timeval, &delta);
|
||||
}
|
||||
g_timeval = tv;
|
||||
_DNBLog (DNBLOG_FLAG_THREADED, "%u +%u.%06u sec [%4.4x/%4.4x]: %s",
|
||||
_DNBLog (DNBLOG_FLAG_THREADED, "%u +%lu.%06u sec [%4.4x/%4.4x]: %s",
|
||||
++g_message_id,
|
||||
delta.tv_sec,
|
||||
delta.tv_usec,
|
||||
|
@ -230,7 +230,7 @@ _DNBLogThreadedIf (uint32_t log_bit, const char *format, ...)
|
|||
timersub (&tv, &g_timeval, &delta);
|
||||
}
|
||||
g_timeval = tv;
|
||||
_DNBLog (DNBLOG_FLAG_THREADED, "%u +%u.%06u sec [%4.4x/%4.4x]: %s",
|
||||
_DNBLog (DNBLOG_FLAG_THREADED, "%u +%lu.%06u sec [%4.4x/%4.4x]: %s",
|
||||
++g_message_id,
|
||||
delta.tv_sec,
|
||||
delta.tv_usec,
|
||||
|
|
|
@ -36,16 +36,16 @@ extern "C" {
|
|||
|
||||
#define DNB_EXPORT __attribute__((visibility("default")))
|
||||
|
||||
void _DNBLog(uint32_t flags, const char *format, ...) DNB_EXPORT;
|
||||
void _DNBLogDebug (const char *fmt, ...) DNB_EXPORT;
|
||||
void _DNBLogDebugVerbose (const char *fmt, ...) DNB_EXPORT;
|
||||
void _DNBLogThreaded (const char *fmt, ...) DNB_EXPORT;
|
||||
void _DNBLogThreadedIf (uint32_t mask, const char *fmt, ...) DNB_EXPORT;
|
||||
void _DNBLogError (const char *fmt, ...) DNB_EXPORT;
|
||||
void _DNBLogFatalError (int err, const char *fmt, ...) DNB_EXPORT;
|
||||
void _DNBLogVerbose (const char *fmt, ...) DNB_EXPORT;
|
||||
void _DNBLogWarning (const char *fmt, ...) DNB_EXPORT;
|
||||
void _DNBLogWarningVerbose (const char *fmt, ...) DNB_EXPORT;
|
||||
void _DNBLog(uint32_t flags, const char *format, ...) __attribute__ ((format (printf, 2, 3))) DNB_EXPORT;
|
||||
void _DNBLogDebug (const char *fmt, ...) __attribute__ ((format (printf, 1, 2))) DNB_EXPORT;
|
||||
void _DNBLogDebugVerbose (const char *fmt, ...) __attribute__ ((format (printf, 1, 2))) DNB_EXPORT;
|
||||
void _DNBLogThreaded (const char *fmt, ...) __attribute__ ((format (printf, 1, 2))) DNB_EXPORT;
|
||||
void _DNBLogThreadedIf (uint32_t mask, const char *fmt, ...) __attribute__ ((format (printf, 2, 3))) DNB_EXPORT;
|
||||
void _DNBLogError (const char *fmt, ...) __attribute__ ((format (printf, 1, 2))) DNB_EXPORT;
|
||||
void _DNBLogFatalError (int err, const char *fmt, ...) __attribute__ ((format (printf, 2, 3))) DNB_EXPORT;
|
||||
void _DNBLogVerbose (const char *fmt, ...) __attribute__ ((format (printf, 1, 2))) DNB_EXPORT;
|
||||
void _DNBLogWarning (const char *fmt, ...) __attribute__ ((format (printf, 1, 2))) DNB_EXPORT;
|
||||
void _DNBLogWarningVerbose (const char *fmt, ...) __attribute__ ((format (printf, 1, 2))) DNB_EXPORT;
|
||||
bool DNBLogCheckLogBit (uint32_t bit) DNB_EXPORT;
|
||||
uint32_t DNBLogSetLogMask (uint32_t mask) DNB_EXPORT;
|
||||
uint32_t DNBLogGetLogMask () DNB_EXPORT;
|
||||
|
|
|
@ -95,12 +95,12 @@ catch_mach_exception_raise_state
|
|||
{
|
||||
if (DNBLogCheckLogBit(LOG_EXCEPTIONS))
|
||||
{
|
||||
DNBLogThreaded("::%s ( exc_port = 0x%4.4x, exc_type = %d ( %s ), exc_data = " MACH_EXCEPTION_DATA_FMT_HEX ", exc_data_count = %d)",
|
||||
__FUNCTION__,
|
||||
exc_port,
|
||||
exc_type, MachException::Name(exc_type),
|
||||
exc_data,
|
||||
exc_data_count);
|
||||
DNBLogThreaded ("::%s ( exc_port = 0x%4.4x, exc_type = %d ( %s ), exc_data = 0x%llx, exc_data_count = %d)",
|
||||
__FUNCTION__,
|
||||
exc_port,
|
||||
exc_type, MachException::Name(exc_type),
|
||||
(uint64_t)exc_data,
|
||||
exc_data_count);
|
||||
}
|
||||
return KERN_FAILURE;
|
||||
}
|
||||
|
@ -125,15 +125,15 @@ catch_mach_exception_raise_state_identity
|
|||
kern_return_t kret;
|
||||
if (DNBLogCheckLogBit(LOG_EXCEPTIONS))
|
||||
{
|
||||
DNBLogThreaded("::%s ( exc_port = 0x%4.4x, thd_port = 0x%4.4x, tsk_port = 0x%4.4x, exc_type = %d ( %s ), exc_data[%d] = { " MACH_EXCEPTION_DATA_FMT_HEX ", " MACH_EXCEPTION_DATA_FMT_HEX " })",
|
||||
DNBLogThreaded("::%s ( exc_port = 0x%4.4x, thd_port = 0x%4.4x, tsk_port = 0x%4.4x, exc_type = %d ( %s ), exc_data[%d] = { 0x%llx, 0x%llx })",
|
||||
__FUNCTION__,
|
||||
exc_port,
|
||||
thread_port,
|
||||
task_port,
|
||||
exc_type, MachException::Name(exc_type),
|
||||
exc_data_count,
|
||||
exc_data_count > 0 ? exc_data[0] : 0xBADDBADD,
|
||||
exc_data_count > 1 ? exc_data[1] : 0xBADDBADD);
|
||||
(uint64_t)(exc_data_count > 0 ? exc_data[0] : 0xBADDBADD),
|
||||
(uint64_t)(exc_data_count > 1 ? exc_data[1] : 0xBADDBADD));
|
||||
}
|
||||
kret = mach_port_deallocate (mach_task_self (), task_port);
|
||||
kret = mach_port_deallocate (mach_task_self (), thread_port);
|
||||
|
@ -154,15 +154,15 @@ catch_mach_exception_raise
|
|||
{
|
||||
if (DNBLogCheckLogBit(LOG_EXCEPTIONS))
|
||||
{
|
||||
DNBLogThreaded("::%s ( exc_port = 0x%4.4x, thd_port = 0x%4.4x, tsk_port = 0x%4.4x, exc_type = %d ( %s ), exc_data[%d] = { " MACH_EXCEPTION_DATA_FMT_HEX ", " MACH_EXCEPTION_DATA_FMT_HEX " })",
|
||||
__FUNCTION__,
|
||||
exc_port,
|
||||
thread_port,
|
||||
task_port,
|
||||
exc_type, MachException::Name(exc_type),
|
||||
exc_data_count,
|
||||
exc_data_count > 0 ? exc_data[0] : 0xBADDBADD,
|
||||
exc_data_count > 1 ? exc_data[1] : 0xBADDBADD);
|
||||
DNBLogThreaded ("::%s ( exc_port = 0x%4.4x, thd_port = 0x%4.4x, tsk_port = 0x%4.4x, exc_type = %d ( %s ), exc_data[%d] = { 0x%llx, 0x%llx })",
|
||||
__FUNCTION__,
|
||||
exc_port,
|
||||
thread_port,
|
||||
task_port,
|
||||
exc_type, MachException::Name(exc_type),
|
||||
exc_data_count,
|
||||
(uint64_t)(exc_data_count > 0 ? exc_data[0] : 0xBADDBADD),
|
||||
(uint64_t)(exc_data_count > 1 ? exc_data[1] : 0xBADDBADD));
|
||||
}
|
||||
|
||||
g_message->task_port = task_port;
|
||||
|
@ -178,7 +178,7 @@ void
|
|||
MachException::Message::Dump() const
|
||||
{
|
||||
DNBLogThreadedIf(LOG_EXCEPTIONS,
|
||||
" exc_msg { bits = 0x%8.8lx size = 0x%8.8lx remote-port = 0x%8.8lx local-port = 0x%8.8lx reserved = 0x%8.8lx id = 0x%8.8lx } ",
|
||||
" exc_msg { bits = 0x%8.8x size = 0x%8.8x remote-port = 0x%8.8x local-port = 0x%8.8x reserved = 0x%8.8x id = 0x%8.8x } ",
|
||||
exc_msg.hdr.msgh_bits,
|
||||
exc_msg.hdr.msgh_size,
|
||||
exc_msg.hdr.msgh_remote_port,
|
||||
|
@ -187,7 +187,7 @@ MachException::Message::Dump() const
|
|||
exc_msg.hdr.msgh_id);
|
||||
|
||||
DNBLogThreadedIf(LOG_EXCEPTIONS,
|
||||
"reply_msg { bits = 0x%8.8lx size = 0x%8.8lx remote-port = 0x%8.8lx local-port = 0x%8.8lx reserved = 0x%8.8lx id = 0x%8.8lx }",
|
||||
"reply_msg { bits = 0x%8.8x size = 0x%8.8x remote-port = 0x%8.8x local-port = 0x%8.8x reserved = 0x%8.8x id = 0x%8.8x }",
|
||||
reply_msg.hdr.msgh_bits,
|
||||
reply_msg.hdr.msgh_size,
|
||||
reply_msg.hdr.msgh_remote_port,
|
||||
|
@ -237,7 +237,7 @@ MachException::Data::GetStopInfo(struct DNBThreadStopInfo *stop_info) const
|
|||
desc += snprintf(desc, end_desc - desc, " data[%zu] = {", stop_info->details.exception.data_count);
|
||||
|
||||
for (idx = 0; desc < end_desc && idx < stop_info->details.exception.data_count; ++idx)
|
||||
desc += snprintf(desc, end_desc - desc, MACH_EXCEPTION_DATA_FMT_MINHEX "%c", exc_data[idx], ((idx + 1 == stop_info->details.exception.data_count) ? '}' : ','));
|
||||
desc += snprintf(desc, end_desc - desc, "0x%llx%c", (uint64_t)exc_data[idx], ((idx + 1 == stop_info->details.exception.data_count) ? '}' : ','));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -275,19 +275,18 @@ MachException::Message::Receive(mach_port_t port, mach_msg_option_t options, mac
|
|||
if (log_exceptions && ((options & MACH_RCV_TIMEOUT) == 0))
|
||||
{
|
||||
// Dump this log message if we have no timeout in case it never returns
|
||||
DNBLogThreaded("::mach_msg ( msg->{bits = %#x, size = %u remote_port = %#x, local_port = %#x, reserved = 0x%x, id = 0x%x}, option = %#x, send_size = %u, rcv_size = %u, rcv_name = %#x, timeout = %u, notify = %#x)",
|
||||
exc_msg.hdr.msgh_bits,
|
||||
exc_msg.hdr.msgh_size,
|
||||
exc_msg.hdr.msgh_remote_port,
|
||||
exc_msg.hdr.msgh_local_port,
|
||||
exc_msg.hdr.msgh_reserved,
|
||||
exc_msg.hdr.msgh_id,
|
||||
options,
|
||||
0,
|
||||
sizeof (exc_msg.data),
|
||||
port,
|
||||
mach_msg_timeout,
|
||||
notify_port);
|
||||
DNBLogThreaded ("::mach_msg ( msg->{bits = %#x, size = %u remote_port = %#x, local_port = %#x, reserved = 0x%x, id = 0x%x}, option = %#x, send_size = 0, rcv_size = %zu, rcv_name = %#x, timeout = %u, notify = %#x)",
|
||||
exc_msg.hdr.msgh_bits,
|
||||
exc_msg.hdr.msgh_size,
|
||||
exc_msg.hdr.msgh_remote_port,
|
||||
exc_msg.hdr.msgh_local_port,
|
||||
exc_msg.hdr.msgh_reserved,
|
||||
exc_msg.hdr.msgh_id,
|
||||
options,
|
||||
sizeof (exc_msg.data),
|
||||
port,
|
||||
mach_msg_timeout,
|
||||
notify_port);
|
||||
}
|
||||
|
||||
err = ::mach_msg (&exc_msg.hdr,
|
||||
|
@ -461,7 +460,7 @@ MachException::Data::Dump() const
|
|||
size_t idx;
|
||||
for (idx = 0; idx < exc_data_count; ++idx)
|
||||
{
|
||||
DNBLogThreadedIf(LOG_EXCEPTIONS, " exc_data[%u]: " MACH_EXCEPTION_DATA_FMT_HEX, idx, exc_data[idx]);
|
||||
DNBLogThreadedIf(LOG_EXCEPTIONS, " exc_data[%zu]: 0x%llx", idx, (uint64_t)exc_data[idx]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,20 +19,6 @@
|
|||
#include <vector>
|
||||
#include "DNBConfig.h"
|
||||
|
||||
#ifdef HAVE_64_BIT_MACH_EXCEPTIONS
|
||||
|
||||
#define MACH_EXCEPTION_DATA_FMT_DEC "%lld"
|
||||
#define MACH_EXCEPTION_DATA_FMT_HEX "0x%16.16llx"
|
||||
#define MACH_EXCEPTION_DATA_FMT_MINHEX "0x%llx"
|
||||
|
||||
#else
|
||||
|
||||
#define MACH_EXCEPTION_DATA_FMT_DEC "%d"
|
||||
#define MACH_EXCEPTION_DATA_FMT_HEX "0x%8.8x"
|
||||
#define MACH_EXCEPTION_DATA_FMT_MINHEX "0x%x"
|
||||
|
||||
#endif
|
||||
|
||||
class MachProcess;
|
||||
class PThreadMutex;
|
||||
|
||||
|
|
|
@ -343,7 +343,7 @@ MachProcess::Kill (const struct timespec *timeout_abstime)
|
|||
::ptrace (PT_KILL, m_pid, 0, 0);
|
||||
DNBError err;
|
||||
err.SetErrorToErrno();
|
||||
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::Kill() DoSIGSTOP() ::ptrace (PT_KILL, pid=%u, 0, 0) => 0x%8.8x (%s)", err.Error(), err.AsString());
|
||||
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::Kill() DoSIGSTOP() ::ptrace (PT_KILL, pid=%u, 0, 0) => 0x%8.8x (%s)", m_pid, err.Error(), err.AsString());
|
||||
m_thread_actions = DNBThreadResumeActions (eStateRunning, 0);
|
||||
PrivateResume ();
|
||||
return true;
|
||||
|
@ -616,7 +616,7 @@ MachProcess::ReplyToAllExceptions ()
|
|||
MachException::Message::iterator end = m_exception_messages.end();
|
||||
for (pos = begin; pos != end; ++pos)
|
||||
{
|
||||
DNBLogThreadedIf(LOG_EXCEPTIONS, "Replying to exception %d...", std::distance(begin, pos));
|
||||
DNBLogThreadedIf(LOG_EXCEPTIONS, "Replying to exception %u...", (uint32_t)std::distance(begin, pos));
|
||||
int thread_reply_signal = 0;
|
||||
|
||||
const DNBThreadResumeAction *action = m_thread_actions.GetActionForThread (pos->state.thread_port, false);
|
||||
|
@ -664,7 +664,7 @@ MachProcess::PrivateResume ()
|
|||
nub_break_t
|
||||
MachProcess::CreateBreakpoint(nub_addr_t addr, nub_size_t length, bool hardware, thread_t tid)
|
||||
{
|
||||
DNBLogThreadedIf(LOG_BREAKPOINTS, "MachProcess::CreateBreakpoint ( addr = 0x%8.8llx, length = %u, hardware = %i, tid = 0x%4.4x )", (uint64_t)addr, length, hardware, tid);
|
||||
DNBLogThreadedIf(LOG_BREAKPOINTS, "MachProcess::CreateBreakpoint ( addr = 0x%8.8llx, length = %zu, hardware = %i, tid = 0x%4.4x )", (uint64_t)addr, length, hardware, tid);
|
||||
if (hardware && tid == INVALID_NUB_THREAD)
|
||||
tid = GetCurrentThread();
|
||||
|
||||
|
@ -672,7 +672,7 @@ MachProcess::CreateBreakpoint(nub_addr_t addr, nub_size_t length, bool hardware,
|
|||
nub_break_t breakID = m_breakpoints.Add(bp);
|
||||
if (EnableBreakpoint(breakID))
|
||||
{
|
||||
DNBLogThreadedIf(LOG_BREAKPOINTS, "MachProcess::CreateBreakpoint ( addr = 0x%8.8llx, length = %u, tid = 0x%4.4x ) => %u", (uint64_t)addr, length, tid, breakID);
|
||||
DNBLogThreadedIf(LOG_BREAKPOINTS, "MachProcess::CreateBreakpoint ( addr = 0x%8.8llx, length = %zu, tid = 0x%4.4x ) => %u", (uint64_t)addr, length, tid, breakID);
|
||||
return breakID;
|
||||
}
|
||||
else
|
||||
|
@ -686,7 +686,7 @@ MachProcess::CreateBreakpoint(nub_addr_t addr, nub_size_t length, bool hardware,
|
|||
nub_watch_t
|
||||
MachProcess::CreateWatchpoint(nub_addr_t addr, nub_size_t length, uint32_t watch_flags, bool hardware, thread_t tid)
|
||||
{
|
||||
DNBLogThreadedIf(LOG_WATCHPOINTS, "MachProcess::CreateWatchpoint ( addr = 0x%8.8llx, length = %u, flags = 0x%8.8x, hardware = %i, tid = 0x%4.4x )", (uint64_t)addr, length, watch_flags, hardware, tid);
|
||||
DNBLogThreadedIf(LOG_WATCHPOINTS, "MachProcess::CreateWatchpoint ( addr = 0x%8.8llx, length = %zu, flags = 0x%8.8x, hardware = %i, tid = 0x%4.4x )", (uint64_t)addr, length, watch_flags, hardware, tid);
|
||||
if (hardware && tid == INVALID_NUB_THREAD)
|
||||
tid = GetCurrentThread();
|
||||
|
||||
|
@ -696,12 +696,12 @@ MachProcess::CreateWatchpoint(nub_addr_t addr, nub_size_t length, uint32_t watch
|
|||
nub_watch_t watchID = m_watchpoints.Add(watch);
|
||||
if (EnableWatchpoint(watchID))
|
||||
{
|
||||
DNBLogThreadedIf(LOG_WATCHPOINTS, "MachProcess::CreateWatchpoint ( addr = 0x%8.8llx, length = %u, tid = 0x%x) => %u", (uint64_t)addr, length, tid, watchID);
|
||||
DNBLogThreadedIf(LOG_WATCHPOINTS, "MachProcess::CreateWatchpoint ( addr = 0x%8.8llx, length = %zu, tid = 0x%x) => %u", (uint64_t)addr, length, tid, watchID);
|
||||
return watchID;
|
||||
}
|
||||
else
|
||||
{
|
||||
DNBLogThreadedIf(LOG_WATCHPOINTS, "MachProcess::CreateWatchpoint ( addr = 0x%8.8llx, length = %u, tid = 0x%x) => FAILED (%u)", (uint64_t)addr, length, tid, watchID);
|
||||
DNBLogThreadedIf(LOG_WATCHPOINTS, "MachProcess::CreateWatchpoint ( addr = 0x%8.8llx, length = %zu, tid = 0x%x) => FAILED (%u)", (uint64_t)addr, length, tid, watchID);
|
||||
m_watchpoints.Remove(watchID);
|
||||
}
|
||||
// We failed to enable the watchpoint
|
||||
|
@ -1071,7 +1071,7 @@ MachProcess::ExceptionMessageBundleComplete()
|
|||
{
|
||||
// We have a complete bundle of exceptions for our child process.
|
||||
PTHREAD_MUTEX_LOCKER (locker, m_exception_messages_mutex);
|
||||
DNBLogThreadedIf(LOG_EXCEPTIONS, "%s: %d exception messages.", __PRETTY_FUNCTION__, m_exception_messages.size());
|
||||
DNBLogThreadedIf(LOG_EXCEPTIONS, "%s: %zu exception messages.", __PRETTY_FUNCTION__, m_exception_messages.size());
|
||||
if (!m_exception_messages.empty())
|
||||
{
|
||||
// Let all threads recover from stopping and do any clean up based
|
||||
|
@ -1140,7 +1140,7 @@ MachProcess::SharedLibrariesUpdated ( )
|
|||
void
|
||||
MachProcess::AppendSTDOUT (char* s, size_t len)
|
||||
{
|
||||
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s (<%d> %s) ...", __FUNCTION__, len, s);
|
||||
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s (<%zu> %s) ...", __FUNCTION__, len, s);
|
||||
PTHREAD_MUTEX_LOCKER (locker, m_stdio_mutex);
|
||||
m_stdout_data.append(s, len);
|
||||
m_events.SetEvents(eEventStdioAvailable);
|
||||
|
@ -1152,7 +1152,7 @@ MachProcess::AppendSTDOUT (char* s, size_t len)
|
|||
size_t
|
||||
MachProcess::GetAvailableSTDOUT (char *buf, size_t buf_size)
|
||||
{
|
||||
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s (&%p[%u]) ...", __FUNCTION__, buf, buf_size);
|
||||
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s (&%p[%zu]) ...", __FUNCTION__, buf, buf_size);
|
||||
PTHREAD_MUTEX_LOCKER (locker, m_stdio_mutex);
|
||||
size_t bytes_available = m_stdout_data.size();
|
||||
if (bytes_available > 0)
|
||||
|
|
|
@ -172,7 +172,7 @@ MachTask::ReadMemory (nub_addr_t addr, nub_size_t size, void *buf)
|
|||
{
|
||||
n = m_vm_memory.Read(task, addr, buf, size);
|
||||
|
||||
DNBLogThreadedIf(LOG_MEMORY, "MachTask::ReadMemory ( addr = 0x%8.8llx, size = %zu, buf = %8.8p) => %u bytes read", (uint64_t)addr, size, buf, n);
|
||||
DNBLogThreadedIf(LOG_MEMORY, "MachTask::ReadMemory ( addr = 0x%8.8llx, size = %zu, buf = %p) => %zu bytes read", (uint64_t)addr, size, buf, n);
|
||||
if (DNBLogCheckLogBit(LOG_MEMORY_DATA_LONG) || (DNBLogCheckLogBit(LOG_MEMORY_DATA_SHORT) && size <= 8))
|
||||
{
|
||||
DNBDataRef data((uint8_t*)buf, n, false);
|
||||
|
@ -194,7 +194,7 @@ MachTask::WriteMemory (nub_addr_t addr, nub_size_t size, const void *buf)
|
|||
if (task != TASK_NULL)
|
||||
{
|
||||
n = m_vm_memory.Write(task, addr, buf, size);
|
||||
DNBLogThreadedIf(LOG_MEMORY, "MachTask::WriteMemory ( addr = 0x%8.8llx, size = %zu, buf = %8.8p) => %u bytes written", (uint64_t)addr, size, buf, n);
|
||||
DNBLogThreadedIf(LOG_MEMORY, "MachTask::WriteMemory ( addr = 0x%8.8llx, size = %zu, buf = %p) => %zu bytes written", (uint64_t)addr, size, buf, n);
|
||||
if (DNBLogCheckLogBit(LOG_MEMORY_DATA_LONG) || (DNBLogCheckLogBit(LOG_MEMORY_DATA_SHORT) && size <= 8))
|
||||
{
|
||||
DNBDataRef data((uint8_t*)buf, n, false);
|
||||
|
@ -284,8 +284,12 @@ MachTask::BasicInfo(task_t task, struct task_basic_info *info)
|
|||
{
|
||||
float user = (float)info->user_time.seconds + (float)info->user_time.microseconds / 1000000.0f;
|
||||
float system = (float)info->user_time.seconds + (float)info->user_time.microseconds / 1000000.0f;
|
||||
DNBLogThreaded("task_basic_info = { suspend_count = %i, virtual_size = 0x%8.8x, resident_size = 0x%8.8x, user_time = %f, system_time = %f }",
|
||||
info->suspend_count, info->virtual_size, info->resident_size, user, system);
|
||||
DNBLogThreaded ("task_basic_info = { suspend_count = %i, virtual_size = 0x%8.8llx, resident_size = 0x%8.8llx, user_time = %f, system_time = %f }",
|
||||
info->suspend_count,
|
||||
(uint64_t)info->virtual_size,
|
||||
(uint64_t)info->resident_size,
|
||||
user,
|
||||
system);
|
||||
}
|
||||
return err.Error();
|
||||
}
|
||||
|
|
|
@ -349,7 +349,7 @@ MachThread::Dump(uint32_t index)
|
|||
default: thread_run_state = "???"; break;
|
||||
}
|
||||
|
||||
DNBLogThreaded("[%3u] #%3u tid: 0x%4.4x, pc: 0x%16.16llx, sp: 0x%16.16llx, breakID: %3d, user: %d.%06.6d, system: %d.%06.6d, cpu: %2d, policy: %2d, run_state: %2d (%s), flags: %2d, suspend_count: %2d (current %2d), sleep_time: %d",
|
||||
DNBLogThreaded("[%3u] #%3u tid: 0x%4.4x, pc: 0x%16.16llx, sp: 0x%16.16llx, breakID: %3d, user: %d.%6.6d, system: %d.%6.6d, cpu: %2d, policy: %2d, run_state: %2d (%s), flags: %2d, suspend_count: %2d (current %2d), sleep_time: %d",
|
||||
index,
|
||||
m_seq_id,
|
||||
m_tid,
|
||||
|
|
|
@ -822,7 +822,7 @@ DNBArchImplI386::GetWatchAddress(const DBG &debug_state, uint32_t hw_index)
|
|||
uint32_t
|
||||
DNBArchImplI386::EnableHardwareWatchpoint (nub_addr_t addr, nub_size_t size, bool read, bool write)
|
||||
{
|
||||
DNBLogThreadedIf(LOG_WATCHPOINTS, "DNBArchImplI386::EnableHardwareWatchpoint(addr = %8.8p, size = %u, read = %u, write = %u)", addr, size, read, write);
|
||||
DNBLogThreadedIf(LOG_WATCHPOINTS, "DNBArchImplI386::EnableHardwareWatchpoint(addr = 0x%llx, size = %zu, read = %u, write = %u)", (uint64_t)addr, size, read, write);
|
||||
|
||||
const uint32_t num_hw_watchpoints = NumSupportedHardwareWatchpoints();
|
||||
|
||||
|
@ -924,8 +924,8 @@ DNBArchImplI386::GetHardwareWatchpointHit(nub_addr_t &addr)
|
|||
{
|
||||
addr = GetWatchAddress(debug_state, i);
|
||||
DNBLogThreadedIf(LOG_WATCHPOINTS,
|
||||
"DNBArchImplI386::GetHardwareWatchpointHit() found => %u (addr = %8.8p).",
|
||||
i, addr);
|
||||
"DNBArchImplI386::GetHardwareWatchpointHit() found => %u (addr = 0x%llx).",
|
||||
i, (uint64_t)addr);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -749,7 +749,7 @@ DNBArchImplX86_64::GetWatchAddress(const DBG &debug_state, uint32_t hw_index)
|
|||
uint32_t
|
||||
DNBArchImplX86_64::EnableHardwareWatchpoint (nub_addr_t addr, nub_size_t size, bool read, bool write)
|
||||
{
|
||||
DNBLogThreadedIf(LOG_WATCHPOINTS, "DNBArchImplX86_64::EnableHardwareWatchpoint(addr = %8.8p, size = %u, read = %u, write = %u)", addr, size, read, write);
|
||||
DNBLogThreadedIf(LOG_WATCHPOINTS, "DNBArchImplX86_64::EnableHardwareWatchpoint(addr = 0x%llx, size = %zu, read = %u, write = %u)", (uint64_t)addr, size, read, write);
|
||||
|
||||
const uint32_t num_hw_watchpoints = NumSupportedHardwareWatchpoints();
|
||||
|
||||
|
@ -851,8 +851,9 @@ DNBArchImplX86_64::GetHardwareWatchpointHit(nub_addr_t &addr)
|
|||
{
|
||||
addr = GetWatchAddress(debug_state, i);
|
||||
DNBLogThreadedIf(LOG_WATCHPOINTS,
|
||||
"DNBArchImplX86_64::GetHardwareWatchpointHit() found => %u (addr = %8.8p).",
|
||||
i, addr);
|
||||
"DNBArchImplX86_64::GetHardwareWatchpointHit() found => %u (addr = 0x%llx).",
|
||||
i,
|
||||
(uint64_t)addr);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -291,8 +291,8 @@ RNBSocket::Write (const void *buffer, size_t length)
|
|||
if (bytessent != length)
|
||||
return rnb_err;
|
||||
|
||||
DNBLogThreadedIf(LOG_RNB_PACKETS, "putpkt: %*s", length, (char *)buffer); // All data is string based in debugserver, so this is safe
|
||||
DNBLogThreadedIf(LOG_RNB_COMM, "sent: %*s", length, (char *)buffer);
|
||||
DNBLogThreadedIf(LOG_RNB_PACKETS, "putpkt: %*s", (int)length, (char *)buffer); // All data is string based in debugserver, so this is safe
|
||||
DNBLogThreadedIf(LOG_RNB_COMM, "sent: %*s", (int)length, (char *)buffer);
|
||||
|
||||
return rnb_success;
|
||||
}
|
||||
|
|
|
@ -447,18 +447,18 @@ HandleProcessStateChange (RNBRemote *remote, bool initialize)
|
|||
|
||||
if (ctx.GetProcessStopCount() == 1)
|
||||
{
|
||||
DNBLogThreadedIf (LOG_RNB_MINIMAL, "%s (&remote, initialize=%i) pid_state = %s pid_stop_count %u (old %u)) Notify??? no, first stop...", __FUNCTION__, (int)initialize, DNBStateAsString (pid_state), ctx.GetProcessStopCount(), prev_pid_stop_count);
|
||||
DNBLogThreadedIf (LOG_RNB_MINIMAL, "%s (&remote, initialize=%i) pid_state = %s pid_stop_count %zu (old %zu)) Notify??? no, first stop...", __FUNCTION__, (int)initialize, DNBStateAsString (pid_state), ctx.GetProcessStopCount(), prev_pid_stop_count);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
DNBLogThreadedIf (LOG_RNB_MINIMAL, "%s (&remote, initialize=%i) pid_state = %s pid_stop_count %u (old %u)) Notify??? YES!!!", __FUNCTION__, (int)initialize, DNBStateAsString (pid_state), ctx.GetProcessStopCount(), prev_pid_stop_count);
|
||||
DNBLogThreadedIf (LOG_RNB_MINIMAL, "%s (&remote, initialize=%i) pid_state = %s pid_stop_count %zu (old %zu)) Notify??? YES!!!", __FUNCTION__, (int)initialize, DNBStateAsString (pid_state), ctx.GetProcessStopCount(), prev_pid_stop_count);
|
||||
remote->NotifyThatProcessStopped ();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DNBLogThreadedIf (LOG_RNB_MINIMAL, "%s (&remote, initialize=%i) pid_state = %s pid_stop_count %u (old %u)) Notify??? skipping...", __FUNCTION__, (int)initialize, DNBStateAsString (pid_state), ctx.GetProcessStopCount(), prev_pid_stop_count);
|
||||
DNBLogThreadedIf (LOG_RNB_MINIMAL, "%s (&remote, initialize=%i) pid_state = %s pid_stop_count %zu (old %zu)) Notify??? skipping...", __FUNCTION__, (int)initialize, DNBStateAsString (pid_state), ctx.GetProcessStopCount(), prev_pid_stop_count);
|
||||
}
|
||||
}
|
||||
return eRNBRunLoopModeInferiorExecuting;
|
||||
|
|
Loading…
Reference in New Issue