Refactor and Add Swift calling conventions to sdb

This commit is contained in:
abcSup 2020-02-10 23:21:01 -08:00 committed by radare
parent 037a521d39
commit ffdb81d41a
4 changed files with 41 additions and 1 deletions

View File

@ -12,3 +12,13 @@ cc.arm16.arg2=r2
cc.arm16.arg3=r3
cc.arm16.argn=stack
cc.arm16.ret=r0
swift=cc
cc.swift.arg0=r0
cc.swift.arg1=r1
cc.swift.arg2=r2
cc.swift.arg3=r3
cc.swift.argn=stack
cc.swift.self=r10
cc.swift.self=r8
cc.swift.ret=r0

View File

@ -11,3 +11,17 @@ cc.arm64.arg6=x6
cc.arm64.arg7=x7
cc.arm64.argn=stack
cc.arm64.ret=x0
swift=cc
cc.swift.arg0=x0
cc.swift.arg1=x1
cc.swift.arg2=x2
cc.swift.arg3=x3
cc.swift.arg4=x4
cc.swift.arg5=x5
cc.swift.arg6=x6
cc.swift.arg7=x7
cc.swift.argn=stack
cc.swift.self=x20
cc.swift.error=x21
cc.swift.ret=x0

View File

@ -21,3 +21,19 @@ cc.amd64.arg8=xmm2
cc.amd64.arg9=xmm3
cc.amd64.arg10=xmm4
cc.amd64.ret=rax
swift=cc
cc.swift.arg0=rdi
cc.swift.arg1=rsi
cc.swift.arg2=rdx
cc.swift.arg3=rcx
cc.swift.arg4=r8
cc.swift.arg5=r9
cc.swift.arg6=xmm0
cc.swift.arg7=xmm1
cc.swift.arg8=xmm2
cc.swift.arg9=xmm3
cc.swift.arg10=xmm4
cc.swift.self=r13
cc.swift.error=r12
cc.swift.ret=rax

View File

@ -137,7 +137,7 @@ R_API bool r_anal_var_add(RAnal *a, ut64 addr, int scope, int delta, char kind,
eprintf ("Invalid var kind '%c'\n", kind);
return false;
}
if (kind == 'r') {
if (kind == R_ANAL_VAR_KIND_REG) {
reg = r_reg_index_get (a->reg, R_ABS (delta));
if (!reg) {
eprintf ("Register wasn't found at the given delta\n");