mirror of
https://github.com/yuzu-emu/unicorn
synced 2024-11-24 06:48:18 +00:00
regress: fix compiled warnings in eflags_nosync.c
This commit is contained in:
parent
f5316dc07a
commit
95745eff3b
2 changed files with 13 additions and 12 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -107,6 +107,7 @@ timeout_segfault
|
|||
rep_movsb
|
||||
mem_double_unmap
|
||||
mips_kseg0_1
|
||||
eflags_nosync
|
||||
|
||||
|
||||
#################
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
|
@ -26,7 +27,7 @@ static bool hook_invalid_mem(uc_engine *uc, uc_mem_type type, uint64_t address,
|
|||
|
||||
if(address == 0)
|
||||
{
|
||||
printf("Address is 0, proof 0x%llX\n", address);
|
||||
printf("Address is 0, proof 0x%" PRIx64 "\n", address);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -36,7 +37,7 @@ static bool hook_invalid_mem(uc_engine *uc, uc_mem_type type, uint64_t address,
|
|||
return false;
|
||||
break;
|
||||
case UC_MEM_WRITE_UNMAPPED:
|
||||
printf("Mapping write address 0x%08llX to aligned 0x%08llX\n", address, address_align);
|
||||
printf("Mapping write address 0x%" PRIx64 " to aligned 0x%" PRIx64 "\n", address, address_align);
|
||||
|
||||
err = uc_mem_map(uc, address_align, PAGE_8K, UC_PROT_ALL);
|
||||
if(err != UC_ERR_OK)
|
||||
|
@ -49,7 +50,7 @@ static bool hook_invalid_mem(uc_engine *uc, uc_mem_type type, uint64_t address,
|
|||
break;
|
||||
case UC_MEM_READ_UNMAPPED:
|
||||
|
||||
printf("Mapping read address 0x%08llX to aligned 0x%08llX\n", address, address_align);
|
||||
printf("Mapping read address 0x%" PRIx64 " to aligned 0x%" PRIx64 "\n", address, address_align);
|
||||
|
||||
|
||||
err = uc_mem_map(uc, address_align, PAGE_8K, UC_PROT_ALL);
|
||||
|
@ -104,7 +105,7 @@ static void VM_exec()
|
|||
err = uc_mem_write(uc, ADDRESS, X86_CODE32, sizeof(X86_CODE32) - 1);
|
||||
if(err != UC_ERR_OK)
|
||||
{
|
||||
printf("Failed to write emulation code to memory, quit!: %s(len %d)", uc_strerror(err), sizeof(X86_CODE32) - 1);
|
||||
printf("Failed to write emulation code to memory, quit!: %s(len %lu)", uc_strerror(err), sizeof(X86_CODE32) - 1);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -158,9 +159,9 @@ static void VM_exec()
|
|||
printf(">>> ESI = 0x%08X %s\n", r_esi, (r_esi == tr_esi ? "" : "(m)"));
|
||||
printf(">>> EDI = 0x%08X %s\n", r_edi, (r_edi == tr_edi ? "" : "(m)"));
|
||||
printf(">>> EIP = 0x%08X %s\n", (r_eip - ADDRESS) + tr_eip, (r_eip == tr_eip ? "" : "(m)\n"));
|
||||
printf(">>> EFLAGS = 0x%08X %s", eflags, (eflags == t_eflags ? "" : "(m)\n"));
|
||||
printf(">>> EFLAGS = 0x%08X %s\n", eflags, (eflags == t_eflags ? "" : "(m)"));
|
||||
|
||||
printf(">>> Instructions executed %llu\n", instructions);
|
||||
printf(">>> Instructions executed %" PRIu64 "\n", instructions);
|
||||
|
||||
assert(r_eax == 0x1DB10106);
|
||||
assert(r_ebx == 0x7EFDE000);
|
||||
|
@ -173,7 +174,6 @@ static void VM_exec()
|
|||
assert(eflags == 0x00000206); //we shouldn't fail this assert, eflags should be 0x00000206 because the last AND instruction produces a non-zero result.
|
||||
|
||||
instructions = 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue