Rename unhandled CPU exception

This commit is contained in:
Hoang-Vu Dang 2016-07-05 11:10:39 -05:00
parent 9cdca5a32b
commit 9a2a5b15d8
8 changed files with 9 additions and 9 deletions

View file

@ -63,7 +63,7 @@ module Common =
let UC_ERR_FETCH_UNALIGNED = 18
let UC_ERR_HOOK_EXIST = 19
let UC_ERR_RESOURCE = 20
let UC_ERR_UNHANDLED_INTERRUPT = 21
let UC_ERR_EXCEPTION = 21
let UC_MEM_READ = 16
let UC_MEM_WRITE = 17
let UC_MEM_FETCH = 18

View file

@ -58,7 +58,7 @@ const (
ERR_FETCH_UNALIGNED = 18
ERR_HOOK_EXIST = 19
ERR_RESOURCE = 20
ERR_UNHANDLED_INTERRUPT = 21
ERR_EXCEPTION = 21
MEM_READ = 16
MEM_WRITE = 17
MEM_FETCH = 18

View file

@ -60,7 +60,7 @@ public interface UnicornConst {
public static final int UC_ERR_FETCH_UNALIGNED = 18;
public static final int UC_ERR_HOOK_EXIST = 19;
public static final int UC_ERR_RESOURCE = 20;
public static final int UC_ERR_UNHANDLED_INTERRUPT = 21;
public static final int UC_ERR_EXCEPTION = 21;
public static final int UC_MEM_READ = 16;
public static final int UC_MEM_WRITE = 17;
public static final int UC_MEM_FETCH = 18;

View file

@ -56,7 +56,7 @@ UC_ERR_WRITE_UNALIGNED = 17
UC_ERR_FETCH_UNALIGNED = 18
UC_ERR_HOOK_EXIST = 19
UC_ERR_RESOURCE = 20
UC_ERR_UNHANDLED_INTERRUPT = 21
UC_ERR_EXCEPTION = 21
UC_MEM_READ = 16
UC_MEM_WRITE = 17
UC_MEM_FETCH = 18

View file

@ -145,7 +145,7 @@ typedef enum uc_err {
UC_ERR_FETCH_UNALIGNED, // Unaligned fetch
UC_ERR_HOOK_EXIST, // hook for this event already existed
UC_ERR_RESOURCE, // Insufficient resource: uc_emu_start()
UC_ERR_UNHANDLED_INTERRUPT // Unhandled CPU interrupt.
UC_ERR_EXCEPTION // Unhandled CPU exception
} uc_err;

View file

@ -139,7 +139,7 @@ int cpu_exec(struct uc_struct *uc, CPUArchState *env) // qq
// Unicorn: If un-catched interrupt, stop executions.
if (!catched) {
cpu->halted = 1;
uc->invalid_error = UC_ERR_UNHANDLED_INTERRUPT;
uc->invalid_error = UC_ERR_EXCEPTION;
ret = EXCP_HLT;
break;
}

View file

@ -18,7 +18,7 @@ class VldrPcInsn(regress.RegressTest):
with self.assertRaises(UcError) as ex_ctx:
uc.emu_start(0x1000, 0x1000 + len(code))
self.assertEquals(ex_ctx.exception.errno, UC_ERR_UNHANDLED_INTERRUPT)
self.assertEquals(ex_ctx.exception.errno, UC_ERR_EXCEPTION)
if __name__ == '__main__':
regress.main()

4
uc.c
View file

@ -96,8 +96,8 @@ const char *uc_strerror(uc_err code)
return "Fetch from unaligned memory (UC_ERR_FETCH_UNALIGNED)";
case UC_ERR_RESOURCE:
return "Insufficient resource (UC_ERR_RESOURCE)";
case UC_ERR_UNHANDLED_INTERRUPT:
return "Unhandled machine interrupt (UC_ERR_UNHANDLED_INTERRUPT)";
case UC_ERR_EXCEPTION:
return "Unhandled CPU exception (UC_ERR_EXCEPTION)";
}
}