From c9a39a8b62b01d237348a4ed60c68700b261e067 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Sun, 30 Jun 2013 07:53:17 -0700 Subject: [PATCH] Dumping module info on startup and logging unimplemented kernel calls. --- src/xenia/cpu/global_exports.cc | 8 +++++--- src/xenia/kernel/modules/xboxkrnl/objects/xmodule.cc | 5 +++-- src/xenia/kernel/xex2.cc | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/xenia/cpu/global_exports.cc b/src/xenia/cpu/global_exports.cc index 305eed7ae..fc558a843 100644 --- a/src/xenia/cpu/global_exports.cc +++ b/src/xenia/cpu/global_exports.cc @@ -36,7 +36,7 @@ void _cdecl XeTrap( void* _cdecl XeIndirectBranch( xe_ppc_state_t* state, uint64_t target, uint64_t br_ia) { // TODO(benvanik): track this statistic - this path is very slow! - Processor* processor = (Processor*)state->processor; + Processor* processor = state->processor; void* target_ptr = processor->GetFunctionPointer((uint32_t)target); // target_ptr will be null when the given target is not a function. XEASSERTNOTNULL(target_ptr); @@ -78,9 +78,11 @@ void _cdecl XeTraceKernelCall( KernelExport* kernel_export) { uint32_t thread_id = state->thread_state->thread_id(); xe_log_line("", thread_id, "XeTraceKernelCall", 't', - "KERNEL CALL: %.8X -> k.%.8X (%s)", + "KERNEL CALL: %.8X -> k.%.8X (%s)%s", (uint32_t)call_ia - 4, (uint32_t)cia, - kernel_export ? kernel_export->name : "unknown"); + kernel_export ? kernel_export->name : "unknown", + (kernel_export ? kernel_export->is_implemented : 0) ? + "" : " NOT IMPLEMENTED"); } void _cdecl XeTraceUserCall( diff --git a/src/xenia/kernel/modules/xboxkrnl/objects/xmodule.cc b/src/xenia/kernel/modules/xboxkrnl/objects/xmodule.cc index 1e5ea2bf7..506927c59 100644 --- a/src/xenia/kernel/modules/xboxkrnl/objects/xmodule.cc +++ b/src/xenia/kernel/modules/xboxkrnl/objects/xmodule.cc @@ -124,7 +124,8 @@ X_STATUS XModule::Launch(uint32_t flags) { // Set as the main module, while running. kernel_state()->SetExecutableModule(this); - fflush(stdout); + + Dump(); // Create a thread to run in. XThread* thread = new XThread( @@ -292,7 +293,7 @@ void XModule::Dump() { unimpl_count++; } } - printf(" Total: %4zu\n", import_info_count); + printf(" Total: %4u\n", import_info_count); printf(" Known: %3d%% (%d known, %d unknown)\n", (int)(known_count / (float)import_info_count * 100.0f), known_count, unknown_count); diff --git a/src/xenia/kernel/xex2.cc b/src/xenia/kernel/xex2.cc index e3ee007f2..1f36d1328 100644 --- a/src/xenia/kernel/xex2.cc +++ b/src/xenia/kernel/xex2.cc @@ -939,7 +939,7 @@ int xe_xex2_get_import_infos(xe_xex2_ref xex, const uint32_t type = (value & 0xFF000000) >> 24; // Verify library index matches given library. - XEASSERT(library_index == ((value >> 16) & 0xFF)); + //XEASSERT(library_index == ((value >> 16) & 0xFF)); switch (type) { case 0x00: @@ -959,7 +959,7 @@ int xe_xex2_get_import_infos(xe_xex2_ref xex, } break; default: - XEASSERTALWAYS(); + //XEASSERTALWAYS(); break; } }