stella
stella copied to clipboard
Debugger crashing
During development of a 4K ROM, the debugger suddenly started crashing right at the start. Something in the ROM code causes this. This is no new bug, all Stella versions (tested down to 4.7.2) crash. DiStella runs endlessly.
Not reproducible anymore. But the bug was real (myAddressQueue
grew endlessly). Also the disassembly partially failed. Something in Distella
is buggy.
Meanwhile I found out, that the myAddressQueue
virtually explodes in size. No clue why, though.
Attached is an example ROM. The_Core.zip
The freeze seems to happen more frequently if you call it via command line, e.g. stella.exe rom.bin
Found the problem: I had an old .cfg file with a matching name stored in Stella's cfg
folder. After removing it, everything is fine.
test.zip
It seems that the provided address ranges are not at opcode boundaries (e.g. adding a NOP to the source code changes the freezing) and therefore cause an endless loop. But IMO even an invalid .cfg file should not freeze Stella. Nevertheless, I reduced the priority.
So this cfg file fails only with the ROM posted in the previous comment?
Not only with this file. I had the problems long before (I use to call all my assembled files test.bin).
If the ROM has the same name as the config file, then Stella loads the directives. And if these directives conflict (in a certain way) with the ROM's code, then DiStella loops endlessly.
Maybe by removing the directives step by step, I can identify what exactly causes this.
Minimized the directives in test.cfg
into:
ORG f000
ROW f4b9 f4b9
ROW f787 f787
Debugger still freezes.
Disassembled addresses not marked as CODE
will be pushed to the address queue and marked as CODE
. However, if the address has a directive, then the directive has priority over the code marking. Then the address would be pushed over and over to the address queue. To avoid this, there is a check at the beginning of DiStella::disasmFromAddress
. This check was lacking ROW
and that caused an endless loop if the ROW
directive pointed to a jump/branch address.
Fix breaks finding 'tentative code'.