Overhaul logging.
This commit is contained in:
@@ -31,7 +31,7 @@ void KeCertMonitorCallback(cpu::ppc::PPCContext* ppc_context,
|
||||
kernel::KernelState* kernel_state) {
|
||||
auto id = ppc_context->r[3];
|
||||
auto arg = ppc_context->r[4];
|
||||
XELOGI("KeCertMonitorCallback(%u, %08x)", id, arg);
|
||||
XELOGI("KeCertMonitorCallback({}, {:08X})", id, arg);
|
||||
auto xboxkrnl = kernel_state->GetKernelModule<XboxkrnlModule>("xboxkrnl.exe");
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ void KeDebugMonitorCallback(cpu::ppc::PPCContext* ppc_context,
|
||||
auto id = static_cast<DebugMonitorCommand>(ppc_context->r[3] & 0xFFFFFFFFu);
|
||||
auto arg = static_cast<uint32_t>(ppc_context->r[4] & 0xFFFFFFFFu);
|
||||
|
||||
XELOGI("KeDebugMonitorCallback(%u, %08x)", static_cast<uint32_t>(id), arg);
|
||||
XELOGI("KeDebugMonitorCallback({}, {:08X})", static_cast<uint32_t>(id), arg);
|
||||
|
||||
if (!cvars::kernel_pix) {
|
||||
SHIM_SET_RETURN_32(-1);
|
||||
@@ -55,8 +55,8 @@ void KeDebugMonitorCallback(cpu::ppc::PPCContext* ppc_context,
|
||||
switch (id) {
|
||||
case DebugMonitorCommand::PIXCommandResult: {
|
||||
auto s = kernel_state->memory()->TranslateVirtual<const char*>(arg);
|
||||
debugging::DebugPrint("%s\n", s);
|
||||
XELOGD("PIX command result: %s\n", s);
|
||||
debugging::DebugPrint("{}\n", s);
|
||||
XELOGD("PIX command result: {}\n", s);
|
||||
if (strcmp(s, "PIX!{CaptureFileCreationEnded} 0x00000000") == 0) {
|
||||
xboxkrnl->SendPIXCommand("{BeginCapture}");
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ dword_result_t XMAInitializeContext(lpvoid_t context_ptr,
|
||||
assert_true(input_buffer_0_physical_address != UINT32_MAX);
|
||||
if (input_buffer_0_physical_address == UINT32_MAX) {
|
||||
XELOGE(
|
||||
"XMAInitializeContext: Invalid input buffer 0 virtual address %.8X",
|
||||
"XMAInitializeContext: Invalid input buffer 0 virtual address {:08X}",
|
||||
input_buffer_0_guest_ptr);
|
||||
return X_E_FALSE;
|
||||
}
|
||||
@@ -143,7 +143,7 @@ dword_result_t XMAInitializeContext(lpvoid_t context_ptr,
|
||||
assert_true(input_buffer_1_physical_address != UINT32_MAX);
|
||||
if (input_buffer_1_physical_address == UINT32_MAX) {
|
||||
XELOGE(
|
||||
"XMAInitializeContext: Invalid input buffer 1 virtual address %.8X",
|
||||
"XMAInitializeContext: Invalid input buffer 1 virtual address {:08X}",
|
||||
input_buffer_1_guest_ptr);
|
||||
return X_E_FALSE;
|
||||
}
|
||||
@@ -154,7 +154,7 @@ dword_result_t XMAInitializeContext(lpvoid_t context_ptr,
|
||||
kernel_memory()->GetPhysicalAddress(output_buffer_guest_ptr);
|
||||
assert_true(output_buffer_physical_address != UINT32_MAX);
|
||||
if (output_buffer_physical_address == UINT32_MAX) {
|
||||
XELOGE("XMAInitializeContext: Invalid output buffer virtual address %.8X",
|
||||
XELOGE("XMAInitializeContext: Invalid output buffer virtual address {:08X}",
|
||||
output_buffer_guest_ptr);
|
||||
return X_E_FALSE;
|
||||
}
|
||||
@@ -234,7 +234,7 @@ dword_result_t XMASetInputBuffer0(lpvoid_t context_ptr, lpvoid_t buffer,
|
||||
assert_true(buffer_physical_address != UINT32_MAX);
|
||||
if (buffer_physical_address == UINT32_MAX) {
|
||||
// Xenia-specific safety check.
|
||||
XELOGE("XMASetInputBuffer0: Invalid buffer virtual address %.8X",
|
||||
XELOGE("XMASetInputBuffer0: Invalid buffer virtual address {:08X}",
|
||||
buffer.guest_address());
|
||||
return X_E_FALSE;
|
||||
}
|
||||
@@ -275,7 +275,7 @@ dword_result_t XMASetInputBuffer1(lpvoid_t context_ptr, lpvoid_t buffer,
|
||||
assert_true(buffer_physical_address != UINT32_MAX);
|
||||
if (buffer_physical_address == UINT32_MAX) {
|
||||
// Xenia-specific safety check.
|
||||
XELOGE("XMASetInputBuffer1: Invalid buffer virtual address %.8X",
|
||||
XELOGE("XMASetInputBuffer1: Invalid buffer virtual address {:08X}",
|
||||
buffer.guest_address());
|
||||
return X_E_FALSE;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ void HandleSetThreadName(pointer_t<X_EXCEPTION_RECORD> record) {
|
||||
}
|
||||
|
||||
if (thread) {
|
||||
XELOGD("SetThreadName(%d, %s)", thread->thread_id(), name);
|
||||
XELOGD("SetThreadName({}, {})", thread->thread_id(), name);
|
||||
thread->set_name(name);
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ DECLARE_XBOXKRNL_EXPORT2(RtlRaiseException, kDebug, kStub, kImportant);
|
||||
|
||||
void KeBugCheckEx(dword_t code, dword_t param1, dword_t param2, dword_t param3,
|
||||
dword_t param4) {
|
||||
XELOGD("*** STOP: 0x%.8X (0x%.8X, 0x%.8X, 0x%.8X, 0x%.8X)", code, param1,
|
||||
XELOGD("*** STOP: {:#08X} ({:#08X}, {:#08X}, {:#08X}, {:#08X})", code, param1,
|
||||
param2, param3, param4);
|
||||
fflush(stdout);
|
||||
xe::debugging::Break();
|
||||
|
||||
@@ -997,7 +997,7 @@ uint32_t xeRtlNtStatusToDosError(uint32_t source_status) {
|
||||
if (!result) {
|
||||
break;
|
||||
}
|
||||
XELOGI("RtlNtStatusToDosError %X => %X", status, result);
|
||||
XELOGI("RtlNtStatusToDosError {:X} => {:X}", status, result);
|
||||
return result;
|
||||
}
|
||||
++error_table;
|
||||
|
||||
@@ -375,7 +375,7 @@ dword_result_t NtSetInformationFile(
|
||||
info = 0;
|
||||
bool delete_on_close =
|
||||
(xe::load_and_swap<uint8_t>(file_info)) ? true : false;
|
||||
XELOGW("NtSetInformationFile ignoring delete on close: %d",
|
||||
XELOGW("NtSetInformationFile ignoring delete on close: {}",
|
||||
delete_on_close);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ dword_result_t NtAllocateVirtualMemory(lpdword_t base_addr_ptr,
|
||||
}
|
||||
}
|
||||
|
||||
XELOGD("NtAllocateVirtualMemory = %.8X", address);
|
||||
XELOGD("NtAllocateVirtualMemory = {:08X}", address);
|
||||
|
||||
// Stash back.
|
||||
// Maybe set X_STATUS_ALREADY_COMMITTED if MEM_COMMIT?
|
||||
@@ -356,7 +356,7 @@ dword_result_t MmAllocatePhysicalMemoryEx(dword_t flags, dword_t region_size,
|
||||
// Failed - assume no memory available.
|
||||
return 0;
|
||||
}
|
||||
XELOGD("MmAllocatePhysicalMemoryEx = %.8X", base_address);
|
||||
XELOGD("MmAllocatePhysicalMemoryEx = {:08X}", base_address);
|
||||
|
||||
return base_address;
|
||||
}
|
||||
|
||||
@@ -65,8 +65,8 @@ bool XboxkrnlModule::SendPIXCommand(const char* cmd) {
|
||||
xe::countof(args));
|
||||
global_lock.lock();
|
||||
|
||||
XELOGD("PIX(command): %s", cmd);
|
||||
XELOGD("PIX(response): %s", response);
|
||||
XELOGD("PIX(command): {}", cmd);
|
||||
XELOGD("PIX(response): {}", response);
|
||||
|
||||
memory_->SystemHeapFree(scratch_ptr);
|
||||
|
||||
|
||||
@@ -830,7 +830,7 @@ SHIM_CALL DbgPrint_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
||||
return;
|
||||
}
|
||||
|
||||
XELOGD("(DbgPrint) %s", data.str().c_str());
|
||||
XELOGD("(DbgPrint) {}", data.str());
|
||||
|
||||
SHIM_SET_RETURN_32(X_STATUS_SUCCESS);
|
||||
}
|
||||
@@ -841,7 +841,7 @@ SHIM_CALL _snprintf_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
||||
int32_t buffer_count = SHIM_GET_ARG_32(1);
|
||||
uint32_t format_ptr = SHIM_GET_ARG_32(2);
|
||||
|
||||
XELOGD("_snprintf(%08X, %i, %08X, ...)", buffer_ptr, buffer_count,
|
||||
XELOGD("_snprintf({:08X}, {}, {:08X}, ...)", buffer_ptr, buffer_count,
|
||||
format_ptr);
|
||||
|
||||
if (buffer_ptr == 0 || buffer_count <= 0 || format_ptr == 0) {
|
||||
@@ -877,7 +877,7 @@ SHIM_CALL sprintf_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
||||
uint32_t buffer_ptr = SHIM_GET_ARG_32(0);
|
||||
uint32_t format_ptr = SHIM_GET_ARG_32(1);
|
||||
|
||||
XELOGD("sprintf(%08X, %08X, ...)", buffer_ptr, format_ptr);
|
||||
XELOGD("sprintf({:08X}, {:08X}, ...)", buffer_ptr, format_ptr);
|
||||
|
||||
if (buffer_ptr == 0 || format_ptr == 0) {
|
||||
SHIM_SET_RETURN_32(-1);
|
||||
@@ -906,7 +906,7 @@ SHIM_CALL _snwprintf_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
||||
int32_t buffer_count = SHIM_GET_ARG_32(1);
|
||||
uint32_t format_ptr = SHIM_GET_ARG_32(2);
|
||||
|
||||
XELOGD("_snwprintf(%08X, %i, %08X, ...)", buffer_ptr, buffer_count,
|
||||
XELOGD("_snwprintf({:08X}, {}, {:08X}, ...)", buffer_ptr, buffer_count,
|
||||
format_ptr);
|
||||
|
||||
if (buffer_ptr == 0 || buffer_count <= 0 || format_ptr == 0) {
|
||||
@@ -942,7 +942,7 @@ SHIM_CALL swprintf_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
||||
uint32_t buffer_ptr = SHIM_GET_ARG_32(0);
|
||||
uint32_t format_ptr = SHIM_GET_ARG_32(1);
|
||||
|
||||
XELOGD("swprintf(%08X, %08X, ...)", buffer_ptr, format_ptr);
|
||||
XELOGD("swprintf({:08X}, {:08X}, ...)", buffer_ptr, format_ptr);
|
||||
|
||||
if (buffer_ptr == 0 || format_ptr == 0) {
|
||||
SHIM_SET_RETURN_32(-1);
|
||||
@@ -972,7 +972,7 @@ SHIM_CALL _vsnprintf_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
||||
uint32_t format_ptr = SHIM_GET_ARG_32(2);
|
||||
uint32_t arg_ptr = SHIM_GET_ARG_32(3);
|
||||
|
||||
XELOGD("_vsnprintf(%08X, %i, %08X, %08X)", buffer_ptr, buffer_count,
|
||||
XELOGD("_vsnprintf({:08X}, {}, {:08X}, {:08X})", buffer_ptr, buffer_count,
|
||||
format_ptr, arg_ptr);
|
||||
|
||||
if (buffer_ptr == 0 || buffer_count <= 0 || format_ptr == 0) {
|
||||
@@ -1012,7 +1012,7 @@ SHIM_CALL _vsnwprintf_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
||||
uint32_t format_ptr = SHIM_GET_ARG_32(2);
|
||||
uint32_t arg_ptr = SHIM_GET_ARG_32(3);
|
||||
|
||||
XELOGD("_vsnwprintf(%08X, %i, %08X, %08X)", buffer_ptr, buffer_count,
|
||||
XELOGD("_vsnwprintf({:08X}, {}, {:08X}, {:08X})", buffer_ptr, buffer_count,
|
||||
format_ptr, arg_ptr);
|
||||
|
||||
if (buffer_ptr == 0 || buffer_count <= 0 || format_ptr == 0) {
|
||||
@@ -1051,7 +1051,7 @@ SHIM_CALL vsprintf_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
||||
uint32_t format_ptr = SHIM_GET_ARG_32(1);
|
||||
uint32_t arg_ptr = SHIM_GET_ARG_32(2);
|
||||
|
||||
XELOGD("vsprintf(%08X, %08X, %08X)", buffer_ptr, format_ptr, arg_ptr);
|
||||
XELOGD("vsprintf({:08X}, {:08X}, {:08X})", buffer_ptr, format_ptr, arg_ptr);
|
||||
|
||||
if (buffer_ptr == 0 || format_ptr == 0) {
|
||||
SHIM_SET_RETURN_32(-1);
|
||||
@@ -1079,7 +1079,7 @@ SHIM_CALL _vscwprintf_shim(PPCContext* ppc_context, KernelState* kernel_state) {
|
||||
uint32_t format_ptr = SHIM_GET_ARG_32(0);
|
||||
uint32_t arg_ptr = SHIM_GET_ARG_32(1);
|
||||
|
||||
XELOGD("_vscwprintf(%08X, %08X)", format_ptr, arg_ptr);
|
||||
XELOGD("_vscwprintf({:08X}, {:08X})", format_ptr, arg_ptr);
|
||||
|
||||
if (format_ptr == 0) {
|
||||
SHIM_SET_RETURN_32(-1);
|
||||
|
||||
@@ -129,7 +129,7 @@ dword_result_t ExCreateThread(lpdword_t handle_ptr, dword_t stack_size,
|
||||
X_STATUS result = thread->Create();
|
||||
if (XFAILED(result)) {
|
||||
// Failed!
|
||||
XELOGE("Thread creation failed: %.8X", result);
|
||||
XELOGE("Thread creation failed: {:08X}", result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -872,7 +872,7 @@ DECLARE_XBOXKRNL_EXPORT3(NtSignalAndWaitForSingleObjectEx, kThreading,
|
||||
|
||||
uint32_t xeKeKfAcquireSpinLock(uint32_t* lock) {
|
||||
// XELOGD(
|
||||
// "KfAcquireSpinLock(%.8X)",
|
||||
// "KfAcquireSpinLock({:08X})",
|
||||
// lock_ptr);
|
||||
|
||||
// Lock.
|
||||
|
||||
@@ -370,7 +370,7 @@ void VdSwap(lpvoid_t buffer_ptr, // ptr into primary ringbuffer
|
||||
assert_true(frontbuffer_address != UINT32_MAX);
|
||||
if (frontbuffer_address == UINT32_MAX) {
|
||||
// Xenia-specific safety check.
|
||||
XELOGE("VdSwap: Invalid front buffer virtual address 0x%.8X",
|
||||
XELOGE("VdSwap: Invalid front buffer virtual address {:#08X}",
|
||||
fetch.base_address << 12);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user