Re: [hatari-devel] Entering Hatari debugger on ILLEGAL instruction |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
Hi Uwe,
On 27.7.2024 0.36, Uwe Seimet wrote:
Thank you, now I understand, and it works as I would have liked it to work.
On Fri, 26 Jul 2024 at 22:33, Uwe Seimet <Uwe.Seimet@xxxxxxxxx> wrote:
I might not be using this tool correctly, because it does not work.
In what way?
Being able to tell Hatari on the command line to enter the debugger on an
ILLEGAL instruction is what I had hoped for.
You can set breakpoint in debugger command file, and tell Hatari to
parse that file before emulation starts:
hatari --parse debugger-commands.txt
I think you have misunderstood what the tool does. It's a helper script
which tells you what you need to write to the debugger. So in your case you
are interested in the ILLEGAL instruction and the tool tells you that its
opcode is $4afc, so the right command to write after entering the debugger
is "b (pc).w = $4afc" (and continue).
To me this looks like exactly what you asked for.
Btw. ILLEGAL instruction case is simple one, as one can match
instruction opcode directly.
Tool is needed more with opcodes where specific parts of the opcode have
to be masked out.
Couple of examples for those:
--------------------------------------
m68k-instruction: asl register
Instruction:
asl register - 1110ccc1ssi00rrr
Bits:
- c: condition / count
- s: size (byte/word/long)
- i: dynamic, not immediate data
- r: data / address register
Hatari breakpoint:
b (pc).w & $f118 = $e100
--------------------------------------
m68k-instruction: asl memory
Instruction:
asl memory - 1110000111mmmaaa
Bits:
- m: effective address mode
- a: effective address register
Hatari breakpoint:
b (pc).w & $ffc0 = $e1c0
--------------------------------------
(Matching specific values for the changing / masked-out parts, is left
as exercise for the reader...)
- Eero