clang-format
This commit is contained in:
parent
0f14575592
commit
442e5f2840
|
@ -369,14 +369,16 @@ bool DiscoverTests(std::wstring& test_path,
|
|||
|
||||
#ifdef _MSC_VER
|
||||
int filter(unsigned int code) {
|
||||
if (code == EXCEPTION_ILLEGAL_INSTRUCTION)
|
||||
if (code == EXCEPTION_ILLEGAL_INSTRUCTION) {
|
||||
return EXCEPTION_EXECUTE_HANDLER;
|
||||
|
||||
}
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
#endif
|
||||
|
||||
void ProtectedRunTest(TestSuite &test_suite, TestRunner &runner, TestCase &test_case, int &failed_count, int &passed_count) {
|
||||
void ProtectedRunTest(TestSuite& test_suite, TestRunner& runner,
|
||||
TestCase& test_case, int& failed_count,
|
||||
int& passed_count) {
|
||||
#ifdef _MSC_VER
|
||||
__try {
|
||||
#endif
|
||||
|
@ -393,7 +395,8 @@ void ProtectedRunTest(TestSuite &test_suite, TestRunner &runner, TestCase &test_
|
|||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
} __except (filter(GetExceptionCode())) {
|
||||
}
|
||||
__except(filter(GetExceptionCode())) {
|
||||
XELOGE(" TEST FAILED (UNSUPPORTED INSTRUCTION)");
|
||||
++failed_count;
|
||||
}
|
||||
|
@ -442,7 +445,8 @@ bool RunTests(const std::wstring& test_name) {
|
|||
for (auto& test_case : test_suite.test_cases) {
|
||||
XELOGI(" - %s", test_case.name.c_str());
|
||||
TestRunner runner;
|
||||
ProtectedRunTest(test_suite, runner, test_case, failed_count, passed_count);
|
||||
ProtectedRunTest(test_suite, runner, test_case, failed_count,
|
||||
passed_count);
|
||||
}
|
||||
|
||||
XELOGI("");
|
||||
|
|
|
@ -29,13 +29,9 @@ XModule::XModule(KernelState* kernel_state, const std::string& path)
|
|||
}
|
||||
}
|
||||
|
||||
XModule::~XModule() {
|
||||
kernel_state_->UnregisterModule(this);
|
||||
}
|
||||
XModule::~XModule() { kernel_state_->UnregisterModule(this); }
|
||||
|
||||
void XModule::OnLoad() {
|
||||
kernel_state_->RegisterModule(this);
|
||||
}
|
||||
void XModule::OnLoad() { kernel_state_->RegisterModule(this); }
|
||||
|
||||
X_STATUS XModule::GetSection(const char* name, uint32_t* out_section_data,
|
||||
uint32_t* out_section_size) {
|
||||
|
|
|
@ -153,8 +153,7 @@ void* XUserModule::GetProcAddressByName(const char* name) {
|
|||
int ret = xe_xex2_lookup_export(xex_, name, export);
|
||||
|
||||
// Failure.
|
||||
if (ret)
|
||||
return NULL;
|
||||
if (ret) return NULL;
|
||||
|
||||
return (void*)export.addr;
|
||||
}
|
||||
|
|
|
@ -997,13 +997,21 @@ int xe_xex2_lookup_export(xe_xex2_ref xex, const char *name,
|
|||
return 1;
|
||||
}
|
||||
|
||||
uint64_t baseaddr = (uint64_t)xex->memory->TranslateVirtual(header->exe_address);
|
||||
IMAGE_EXPORT_DIRECTORY *e = (PIMAGE_EXPORT_DIRECTORY)(baseaddr + header->export_table_offset);
|
||||
uint64_t baseaddr =
|
||||
(uint64_t)xex->memory->TranslateVirtual(header->exe_address);
|
||||
IMAGE_EXPORT_DIRECTORY *e =
|
||||
(PIMAGE_EXPORT_DIRECTORY)(baseaddr + header->export_table_offset);
|
||||
|
||||
// e->AddressOfX RVAs are relative to the IMAGE_EXPORT_DIRECTORY!
|
||||
uint32_t* function_table = (uint32_t*)((uint64_t)e + e->AddressOfFunctions); // Functions relative to base
|
||||
uint32_t* name_table = (uint32_t*)((uint64_t)e + e->AddressOfNames); // Names relative to directory
|
||||
uint16_t* ordinal_table = (uint16_t*)((uint64_t)e + e->AddressOfNameOrdinals); // Table of ordinals
|
||||
uint32_t *function_table =
|
||||
(uint32_t *)((uint64_t)e +
|
||||
e->AddressOfFunctions); // Functions relative to base
|
||||
uint32_t *name_table =
|
||||
(uint32_t *)((uint64_t)e +
|
||||
e->AddressOfNames); // Names relative to directory
|
||||
uint16_t *ordinal_table =
|
||||
(uint16_t *)((uint64_t)e +
|
||||
e->AddressOfNameOrdinals); // Table of ordinals
|
||||
|
||||
const char *mod_name = (const char *)((uint64_t)e + e->Name);
|
||||
|
||||
|
|
|
@ -253,8 +253,8 @@ SHIM_CALL XexGetProcedureAddress_shim(PPCContext* ppc_state,
|
|||
XELOGD("XexGetProcedureAddress(%.8X, %.8X, %.8X)", module_handle, ordinal,
|
||||
out_function_ptr);
|
||||
} else {
|
||||
XELOGD("XexGetProcedureAddress(%.8X, %.8X(%s), %.8X)", module_handle, ordinal,
|
||||
name, out_function_ptr);
|
||||
XELOGD("XexGetProcedureAddress(%.8X, %.8X(%s), %.8X)", module_handle,
|
||||
ordinal, name, out_function_ptr);
|
||||
}
|
||||
|
||||
X_STATUS result = X_STATUS_INVALID_HANDLE;
|
||||
|
|
Loading…
Reference in New Issue