Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
### 0.37.1

* Fix `make_full_disasm_for_code` not extracting data-only TUs.
* Fix `make_full_disasm_for_code` and `disassemble_all` combo
* Fixes not writing other sections to asm file when both options are enabled.

### 0.37.0

Expand Down
10 changes: 8 additions & 2 deletions src/splat/segtypes/common/codesubsegment.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,10 @@ def split_as_asmtu_file(self, out_path: Path):
if (
isinstance(sibling, CommonSegCodeSubsegment)
and sibling.spim_section is not None
and not sibling.should_self_split()
and (
not sibling.should_self_split()
or options.opts.make_full_disasm_for_code
)
):
f.write("\n")
f.write(f"{sibling.get_section_asm_line()}\n\n")
Expand All @@ -298,7 +301,10 @@ def split_as_asmtu_file(self, out_path: Path):
if (
isinstance(sibling, CommonSegCodeSubsegment)
and sibling.spim_section is not None
and not sibling.should_self_split()
and (
not sibling.should_self_split()
or options.opts.make_full_disasm_for_code
)
):
f.write("\n")
f.write(f"{sibling.get_section_asm_line()}\n\n")
Expand Down
48 changes: 48 additions & 0 deletions test/basic_app/expected/asm/main.s
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,51 @@ glabel func_800004A0
/* 10E8 800004E8 27BD0018 */ addiu $sp, $sp, 0x18
endlabel func_800004A0
/* 10EC 800004EC 00000000 */ nop

.section .data, "wa"

nonmatching D_80000500

dlabel D_80000500
/* 1100 80000500 00000001 */ .word 0x00000001
enddlabel D_80000500

nonmatching D_80000504

dlabel D_80000504
/* 1104 80000504 00000000 */ .word 0x00000000
/* 1108 80000508 00000000 */ .word 0x00000000
/* 110C 8000050C 00000000 */ .word 0x00000000
enddlabel D_80000504

.section .rodata, "a"

nonmatching D_80000510

dlabel D_80000510
/* 1110 80000510 00010203 */ .word 0x00010203
/* 1114 80000514 04050607 */ .word 0x04050607
enddlabel D_80000510

.align 3
nonmatching jtbl_80000518

dlabel jtbl_80000518
/* 1118 80000518 80000448 */ .word .L80000448
/* 111C 8000051C 80000450 */ .word .L80000450
/* 1120 80000520 80000458 */ .word .L80000458
/* 1124 80000524 80000460 */ .word .L80000460
/* 1128 80000528 80000468 */ .word .L80000468
/* 112C 8000052C 80000470 */ .word .L80000470
/* 1130 80000530 80000478 */ .word .L80000478
/* 1134 80000534 80000480 */ .word .L80000480
/* 1138 80000538 00000000 */ .word 0x00000000
/* 113C 8000053C 00000000 */ .word 0x00000000
enddlabel jtbl_80000518

.section .bss, "wa"

nonmatching D_80000540, 0x80

dlabel D_80000540
/* 80000540 */ .space 0x80