Page 1 of 1

CLOSED - How to use GDB-Xroar to debug 6309 code

Posted: Thu Nov 14, 2019 10:36 am
by pser1
Hello,
I have been trying to debug a test program written with lots of 6309 opcodes and have found a lot of trouble
- GDB doesn't decode 6309 opcodes, instead it treats them as FCB data, not very useful :-(
- After LDMD $01 to enter native mode ($3D $01) MD register is not updated!
- After LDW $1111 MD changes to $11 so receiving value from register E, while registers E,F show $00 $00 but next to E
we can see 4352d which is in fact $1100. But reg E is 8 bits, so the decimal value should be less than 256, correct is 17

Should GDB be called in a special way to activate 6309 decoding?
The other behaviour seems more related to the params order that it receives from XRoar ...
Any advice would be greatly apreciated
pere

Re: How to use GDB-Xroar to debug 6309 code

Posted: Thu Nov 14, 2019 11:31 am
by sixxie
Looking at the patches, I don't think 6309 support was ever added. There are some basics about the registers, but nothing about disassembly, or any specific 6309 architecture.

Sorry about that, seems like it needs a lot more work (and if it were to be added to modern GDB, completely redoing!).

..ciaran

Re: How to use GDB-Xroar to debug 6309 code

Posted: Thu Nov 14, 2019 12:02 pm
by pser1
Hi Ciaran,
thanks for answering that fast!
I was afraid that this could be the answer.
I am so comfortable using both XRoar-GDB that I would have liked it for 6309 debugging too :-(

It seems that I will need to use the MAME/MESS emulator if that one is able to understand 6309 coded programs ...

cheers!
pere

Ps. Has anyone used MAME to debug programs/games patched for the 6309?
I would appreciate any hint about the procedure to start MAME for 6309 CPU.
Thanks in advance