simcoupe
simcoupe copied to clipboard
simice: improve handling of multiple symbols pointing to same line
Real code:
@loop:
@var.L:
ld hl,0 ; 0
@var.R:
ld de,0 ; size / 5
simice only shows @loop
As I workaround I can adjust my code to:
@loop:
if defined (debug)
nop
endif
@var.L:
ld hl,0 ; 0
@var.R:
ld de,0 ; size / 5
This probably won't be possible for a while due to the way the disassembly view is handled, where there's a 1:1 address to line assumption in a few places. I'm still looking for a way to move the debugger away from the low-res internal text rendering, so it's probably not worth enhancing what's currently there too much.
The existing symbol table is a 1:1 mapping for value to symbol. It uses the first symbol seen for that value, so only @loop
is shown. I think it allows multiple symbols to map to the same value, so you'll still be able to resolve @var.L
to the same value. Even if the disassembly could show multiple labels, what should references to the label look like? Both LD HL,@loop
and LD HL,@var.L
would give identical code, so what should SimCoupe display?
pyz80 could store the original text representation of each symbol usage, so it knew what to display. That would solve problems of values versus addresses to give closer to a source code level view. Though like a modern PDB file, it could just store the source line that represents each code location instead, and refer to the original source text. At that point it may be better to use VS Code for the debugger, which I've also considered!