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

Hardware Hacking, Programming and Game Solutions/Cheats
Post Reply
pser1
Posts: 1336
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

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

Post by pser1 » Thu Nov 14, 2019 10:36 am

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
Last edited by pser1 on Fri Nov 15, 2019 2:50 pm, edited 2 times in total.

sixxie
Posts: 1097
Joined: Fri Jul 18, 2008 8:36 am
Location: Hertfordshire
Contact:

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

Post by sixxie » Thu Nov 14, 2019 11:31 am

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

pser1
Posts: 1336
Joined: Sun Mar 25, 2012 7:32 pm
Location: Barcelona (SPAIN)

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

Post by pser1 » Thu Nov 14, 2019 12:02 pm

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

Post Reply