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:
@@ -194,7 +194,12 @@ MIPSCPU *cpu_mips_init(struct uc_struct *uc)
|
||||
mips_cpu_initfn(uc, cs);
|
||||
|
||||
env = &cpu->env;
|
||||
env->cpu_model = &(mips_defs[uc->cpu_model]);
|
||||
if(uc->mode & UC_MODE_MIPS64){
|
||||
// 64-bit CPU models are defined in the array directly after 32-bit models
|
||||
env->cpu_model = &(mips_defs[uc->cpu_model + UC_CPU_MIPS32_ENDING]);
|
||||
} else {
|
||||
env->cpu_model = &(mips_defs[uc->cpu_model]);
|
||||
}
|
||||
|
||||
if (env->cpu_model == NULL) {
|
||||
free(cpu);
|
||||
|
||||
Reference in New Issue
Block a user