radare2/test/new/db/cmd/cmd_att
Óscar Carrasco 23bb5bb3cc
Fix afs not showing types and args ##types (#16074)
* Fix by implementing r_anal_fcn_to_str

* Refactor function syntax

* Fix testsuite

* Fix leaking pointers and code review

* Move __add_vars_sdb from aaft to af

* Fix more tests

* Rename r_function_get_name to r_function_get_signature

* Fix regression and remove extra semicolon

* Fix last regressions
2020-03-07 05:34:43 -06:00

131 lines
3.2 KiB
Plaintext

NAME=att relsub
FILE=../bins/mach0/mac-ls
EXPECT=<<EOF
;-- main:
;-- entry0:
;-- func.100001058:
0x100001058 pushq %rbp
0x100001059 movq %rsp, %rbp
0x10000105c pushq %r15
0x10000105e pushq %r14
0x100001060 pushq %r13
0x100001062 pushq %r12
0x100001064 pushq %rbx
0x100001065 subq $0x648, %rsp
0x10000106c movq %rsi, %rbx
0x10000106f movl %edi, %r14d
0x100001072 leaq -0x640(%rbp), %rax
0x100001079 movq %rax, -0x648(%rbp)
0x100001080 testl %r14d, %r14d
0x100001083 jg 0x10000108a
0x100001085 callq sym.func.100004401
0x10000108a leaq section.4.__TEXT.__cstring, %rsi
0x100001091 xorl %edi, %edi
0x100001093 callq sym.imp.setlocale
0x100001098 movl $1, %r13d
0x10000109e movl $1, %edi
EOF
CMDS=<<EOF
e asm.syntax=att
e asm.lines.bb=0
e asm.bytes=0
e asm.comments=false
pd 20
EOF
RUN
NAME=att varsub
FILE=../bins/mach0/mac-ls
EXPECT=<<EOF
;-- entry0:
;-- func.100001058:
/ 2259: int main (int argc, char **argv);
| 0x100001058 pushq %rbp
| 0x100001059 movq %rsp, %rbp
| 0x10000105c pushq %r15
| 0x10000105e pushq %r14
| 0x100001060 pushq %r13
| 0x100001062 pushq %r12
| 0x100001064 pushq %rbx
| 0x100001065 subq $0x648, %rsp
| 0x10000106c movq %rsi, %rbx
| 0x10000106f movl %edi, %r14d
| 0x100001072 leaq var_640h, %rax
| 0x100001079 movq %rax, var_648h
| 0x100001080 testl %r14d, %r14d
| 0x100001083 jg 0x10000108a
| 0x100001085 callq sym.func.100004401
| 0x10000108a leaq section.4.__TEXT.__cstring, %rsi
| 0x100001091 xorl %edi, %edi
| 0x100001093 callq sym.imp.setlocale
| 0x100001098 movl $1, %r13d
| 0x10000109e movl $1, %edi
EOF
CMDS=<<EOF
af
e asm.syntax=att
e asm.var=0
e asm.lines.bb=0
e asm.bytes=0
e asm.comments=false
pd 20
EOF
RUN
NAME=att varsub 2
FILE=../bins/elf/varsub
EXPECT=<<EOF
/ 42: int main (int argc, char **argv, char **envp);
| 0x004004a6 pushq %rbp
| 0x004004a7 movq %rsp, %rbp
| 0x004004aa movq arg_0h, %rax
| 0x004004af movq -8(%rsp), %rax
| 0x004004b4 movq arg_8h, %rax
| 0x004004b8 movq var_8h, %rax
| 0x004004bc movq arg_10h, %rax
| 0x004004c1 movq -0x18(%rsp), %rax
| 0x004004c6 movq arg_18h, %rax
| 0x004004ca movq var_18h, %rax
| 0x004004ce leave
\ 0x004004cf retq
EOF
CMDS=<<EOF
aa; s main
e asm.syntax=att
e asm.var=0
e asm.lines.bb=0
e asm.bytes=0
e asm.comments=false
pdf
EOF
RUN
NAME=att varsub 2 with asm.var.subonly disabled
FILE=../bins/elf/varsub
EXPECT=<<EOF
/ 42: int main (int argc, char **argv, char **envp);
| 0x004004a6 pushq %rbp
| 0x004004a7 movq %rsp, %rbp
| 0x004004aa movq arg_0h(%rsp), %rax
| 0x004004af movq -8(%rsp), %rax
| 0x004004b4 movq arg_8h(%rbp), %rax
| 0x004004b8 movq var_8h(%rbp), %rax
| 0x004004bc movq arg_10h(%rsp), %rax
| 0x004004c1 movq -0x18(%rsp), %rax
| 0x004004c6 movq arg_18h(%rbp), %rax
| 0x004004ca movq var_18h(%rbp), %rax
| 0x004004ce leave
\ 0x004004cf retq
EOF
CMDS=<<EOF
aa; s main
e asm.syntax=att
e asm.var=0
e asm.lines.bb=0
e asm.bytes=0
e asm.comments=false
e asm.var.subonly=false
pdf
EOF
RUN