arch/tms320: pdf rendering tests for c55x and c55x+ functions
Adds full-function disassembly (pdf) tests for non-trivial functions on
both CPUs, to lock in correct rendering of basic-block boundaries,
reflines (forward and backward branches), call/data/string cross-
references and operand formatting.
C55x (emulateme_nostd.ccsv5.c55x.ticoff2.dbg.coff):
- sym._uart_write_hex: a compact two-block function with a forward
conditional branch, an unconditional branch refline and a call ref.
- sym.___text: a four-block loop with conditional branches both ways,
a back-edge, a call into another function, data references and
parallel-instruction (||) operands.
C55x+ (coff2/19_emulateme_nostd.obj):
- sym._c_strlen: a four-block scan loop with a back-edge and forward
and backward bcc reflines.
- sym._main: a five-block function with nested conditional branches
and two call references (_c_strlen, _decrypt).
All four render cleanly with the existing decoder and analyzers; no
behavior change was needed.
This commit is contained in:
parent
13ebcbc2c7
commit
ef4d2334a2
2 changed files with 114 additions and 0 deletions
|
|
@ -578,3 +578,49 @@ type: lea
|
|||
type: lea
|
||||
EOF
|
||||
RUN
|
||||
|
||||
NAME=c55x+ analysis: pdf render - _c_strlen (loop, fwd+back bcc reflines)
|
||||
FILE=bins/tms320/coff2/19_emulateme_nostd.obj
|
||||
ARGS=-A
|
||||
CMDS=<<EOF
|
||||
e analysis.cpu=c55x+
|
||||
pdf @ sym._c_strlen
|
||||
EOF
|
||||
EXPECT=<<EOF
|
||||
; CALL XREF from sym._main @ 0xc9
|
||||
/ sym._c_strlen();
|
||||
| 0x00000056 mov #0x0, t0
|
||||
| .-> 0x00000059 copy *(ar0+t0b), t1
|
||||
| ,==< 0x0000005c bcc #0x000008, t1 == #0
|
||||
| |: 0x0000005f add #0x1, t0
|
||||
| |`=< 0x00000062 bcc #0x00fff2, t0 < #0x7f
|
||||
\ `--> 0x00000067 ret
|
||||
EOF
|
||||
RUN
|
||||
|
||||
NAME=c55x+ analysis: pdf render - _main (nested branches, two call refs)
|
||||
FILE=bins/tms320/coff2/19_emulateme_nostd.obj
|
||||
ARGS=-A
|
||||
CMDS=<<EOF
|
||||
e analysis.cpu=c55x+
|
||||
pdf @ sym._main
|
||||
EOF
|
||||
EXPECT=<<EOF
|
||||
/ int sym._main(int argc, char **argv, char **envp);
|
||||
| 0x000000ba psh t1
|
||||
| ,=< 0x000000bc bcc #0x00001c, t0 != #0x2
|
||||
| | 0x000000c1 mov , ac0
|
||||
| | 0x000000c4 nop_16
|
||||
| | 0x000000c6 mov ac0, xar0
|
||||
| | 0x000000c9 call #0x00ff8a ; sym._c_strlen
|
||||
| ,==< 0x000000cc bcc #0x00000c, t0 != #0x10
|
||||
| || 0x000000d1 call #0x00ff94 ; sym._decrypt
|
||||
| ,===< 0x000000d4 bcc #0x000006, t0 == #0
|
||||
| ||| 0x000000d7 mov #0x0, t0
|
||||
| ||| 0x000000da pop t1
|
||||
| ||| 0x000000dc ret
|
||||
| ```-> 0x000000dd mov #0x1, t0
|
||||
| 0x000000e0 pop t1
|
||||
\ 0x000000e2 ret
|
||||
EOF
|
||||
RUN
|
||||
|
|
|
|||
|
|
@ -783,3 +783,71 @@ type: mov
|
|||
refptr: 2
|
||||
EOF
|
||||
RUN
|
||||
|
||||
NAME=c55x analysis: pdf render - _uart_write_hex (branch + call reflines)
|
||||
FILE=bins/tms320/emulateme_nostd.ccsv5.c55x.ticoff2.dbg.coff
|
||||
ARGS=-A
|
||||
CMDS=<<EOF
|
||||
e analysis.cpu=c55x
|
||||
pdf @ sym._uart_write_hex
|
||||
EOF
|
||||
EXPECT=<<EOF
|
||||
/ sym._uart_write_hex(nstd_uint8_t value);
|
||||
| 0x00000169 cmp t0 == ar1, tc1
|
||||
| 0x0000016c || nop
|
||||
| ,=< 0x0000016d bcc 0x12, tc1 ; sym._decrypt
|
||||
| | 0x00000170 amar *(0x20536D), xar0
|
||||
| | 0x00000176 mov 0x0017, ac0
|
||||
| | 0x0000017a call 0xFEB3 ; fcn.00000030
|
||||
| | 0x0000017d mov 0x1, t0
|
||||
\ ,==< 0x0000017f b 0x005E ; fcn.000000d4+0x10c
|
||||
EOF
|
||||
RUN
|
||||
|
||||
NAME=c55x analysis: pdf render - ___text (multi-BB, reflines both ways, data/call refs)
|
||||
FILE=bins/tms320/emulateme_nostd.ccsv5.c55x.ticoff2.dbg.coff
|
||||
ARGS=-A
|
||||
CMDS=<<EOF
|
||||
e analysis.cpu=c55x
|
||||
pdf @ sym.___text
|
||||
EOF
|
||||
EXPECT=<<EOF
|
||||
;-- .text:
|
||||
;-- _uart_write_text:
|
||||
/ sym.___text();
|
||||
| 0x00000130 mov 0x0, ac0
|
||||
| 0x00000132 cmpu ac0 >= ac1, tc1
|
||||
| ,=< 0x00000135 bcc 0x29, tc1 ; fcn.000000d4+0xc8
|
||||
| | ;-- $C$DW$L$_uart_write_text$2$B:
|
||||
| | ;-- $C$L1:
|
||||
| | 0x00000138 mov 0x0000 << #16, ac1
|
||||
| | 0x0000013c or 0x8004, ac1, ac1
|
||||
| | 0x00000140 add ac0, ac1
|
||||
| | 0x00000142 mov ac1, xar3
|
||||
| | 0x00000144 mov 0x0000 << #16, ac1
|
||||
| | 0x00000148 or 0x8004, ac1, ac1
|
||||
| | 0x0000014c xor *ar3, ar1, ar2
|
||||
| | 0x0000014f || add ac0, ac1
|
||||
| | 0x00000151 mov ac1, xar3
|
||||
| | 0x00000153 mov ar2, *ar3
|
||||
| | 0x00000155 mov 0x0010, ac1
|
||||
| | 0x00000159 add 0x1, ac0
|
||||
| | 0x0000015b cmpu ac0 < ac1, tc1
|
||||
| ,==< 0x0000015e bcc 0xD7, tc1
|
||||
| || 0x00000161 mov 0x1, t0
|
||||
|| ; CODE XREF from fcn.000000d4 @ 0x12e
|
||||
..
|
||||
|| ;-- $C$L2:
|
||||
|| ;-- $C$DW$L$_uart_write_text$2$E:
|
||||
\ ||`--> 0x000001c5 || min ar0, ar6
|
||||
| || | ;-- (0x000001c9) $C$DW$L$_c_strlen$2$B:
|
||||
| || | ;-- (0x000001c9) $C$L3:
|
||||
| || | 0x000001c7 ~ rptcc 0x4E, t2 == 0
|
||||
| || | 0x000001ca mov 0x1, ac0
|
||||
| || | 0x000001cc call 0xFE61 ; fcn.00000030
|
||||
| || | 0x000001cf mov 0x0, t0
|
||||
| || | ;-- (0x000001d2) $C$L4:
|
||||
| || | ;-- (0x000001d2) $C$DW$L$_c_strlen$2$E:
|
||||
\ ||,==< 0x000001d1 ~ b 0x0D ; fcn.000000d4+0x10c
|
||||
EOF
|
||||
RUN
|
||||
|
|
|
|||
Loading…
Reference in a new issue