Skip to content

Commit f7ff8b5

Browse files
author
oco
committed
Correct CFI initial register state
1 parent 590dc7f commit f7ff8b5

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

examples/tester/makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ st_path = ~/src/stlink
1111
$(project).spf.elf: *.spf
1212
$(compiler) options.spf -H -I -O -d -M S\" $(device)\" S\" $(project).spf\" m3forth.spf
1313
arm-none-eabi-objdump -S -w $(project).spf.elf > $(project).spf.lst
14-
# readelf -Ww $(project).spf.elf > $(project).spf.debug
15-
# readelf -aW $(project).spf.elf > $(project).spf.info
14+
readelf -Ww $(project).spf.elf > $(project).spf.debug
15+
readelf -aW $(project).spf.elf > $(project).spf.info
1616
chmod o+x $(project).spf.elf
1717

1818
# debug project with qemu, uart emulation or semihosting and ddd

lib/dwarf/dwarf.spf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,22 @@ CREATE LAST_SUB /sd ALLOT \ last subprogram data
450450

451451
CREATE init_bytes \ taken from c-code compiled elf
452452
0x0C C, 0x0D C, 0 C, \ equals DW_CFA_def_cfa: r13 ofs 0
453+
0x07 C, 0x00 C, 0 C, \ equals DW_CFA_undefined: r0 undefined
454+
0x07 C, 0x01 C, 0 C, \ equals DW_CFA_undefined: r1 undefined
455+
0x07 C, 0x02 C, 0 C, \ equals DW_CFA_undefined: r2 undefined
456+
0x07 C, 0x03 C, 0 C, \ equals DW_CFA_undefined: r3 undefined
457+
0x07 C, 0x04 C, 0 C, \ equals DW_CFA_undefined: r4 undefined
458+
0x07 C, 0x05 C, 0 C, \ equals DW_CFA_undefined: r5 undefined
459+
0x07 C, 0x06 C, 0 C, \ equals DW_CFA_undefined: r6 undefined
460+
0x07 C, 0x07 C, 0 C, \ equals DW_CFA_undefined: r7 undefined
461+
0x07 C, 0x08 C, 0 C, \ equals DW_CFA_undefined: r8 undefined
462+
0x07 C, 0x09 C, 0 C, \ equals DW_CFA_undefined: r9 undefined
463+
0x07 C, 0x0A C, 0 C, \ equals DW_CFA_undefined: r10 undefined
464+
0x07 C, 0x0B C, 0 C, \ equals DW_CFA_undefined: r11 undefined
465+
0x07 C, 0x0C C, 0 C, \ equals DW_CFA_undefined: r12 undefined
466+
0x0C C, 0x0D C, 0 C, \ equals DW_CFA_def_cfa: r13 ofs 0
467+
\ r14 is specified in dwarf_add_frame_cie
468+
\ r15 is pc, no need to specify init state
453469
HERE init_bytes - CONSTANT init_bytes_len
454470

455471
: dwarf_add_frame_cie ( -- )

0 commit comments

Comments
 (0)