Support MIPS64 - write correct PC register width on uc_emu_start (#2111)

* Support mips64 - write correct pc register width on uc_emu_start

* Convert to UC_MODE_MIPS64

* Correctly select MIPS64 CPU model

* Simple 64-bit test - check it doesn't crash

* lint

* Comment

* Comment

* Add offset when indexing cpu model, makes tests work on older python

* Move test

* add PC check to test

* Fix test - add python version check

* Use RegressTest method for assert
This commit is contained in:
OBarronCS
2025-02-21 05:39:11 -08:00
committed by GitHub
parent 56ba3476e5
commit 76d97f8926
3 changed files with 50 additions and 3 deletions

7
uc.c
View File

@@ -1020,8 +1020,11 @@ uc_err uc_emu_start(uc_engine *uc, uint64_t begin, uint64_t until,
#endif
#ifdef UNICORN_HAS_MIPS
case UC_ARCH_MIPS:
// TODO: MIPS32/MIPS64/BIGENDIAN etc
uc_reg_write(uc, UC_MIPS_REG_PC, &begin_pc32);
if (uc->mode & UC_MODE_MIPS64) {
uc_reg_write(uc, UC_MIPS_REG_PC, &begin);
} else {
uc_reg_write(uc, UC_MIPS_REG_PC, &begin_pc32);
}
break;
#endif
#ifdef UNICORN_HAS_SPARC