Hi all,
Is there a noddy guide to using gdb with xroar? I can get them to connect but need to know how to do things like disassemble from current PC, single step etc.
Cheers.
Phill.
Xroar + GDB
Re: Xroar + GDB
Hi Phill,
I do use XRoar+GDB regularly despite XRoar still refuses to connect to GDB from time to time (more often than I would like )
First of all, I am using Windows 7, not Mac nor Linux, so my explanations will be from this side of the world.
I start them issuing this bat file:
This opens three windows on GDB, see image
Using the manual that comes with GDB I have 'noted' some useful commands, to change registers, memory
and see contents of any place in memory too ...
cheers
pere
Ps. By the way, once you see the disassembled window, command 'SI' steps program line by line
I do use XRoar+GDB regularly despite XRoar still refuses to connect to GDB from time to time (more often than I would like )
First of all, I am using Windows 7, not Mac nor Linux, so my explanations will be from this side of the world.
I start them issuing this bat file:
Code: Select all
cd..
copy ..\XRoar\DOS-ROMs\dplus50.rom ddos40.rom
copy ..\XRoar\ROMs\d64rom1V31.rom d64_1.rom
copy ..\XRoar\ROMs\d64rom2V31.rom d64_2.rom
start xroar -gdb -machine dragon64 -machine-cpu 6309 -extbas d64_1.rom -altbas d64_2.rom -machine-cart dragondos -cart-rom ddos40.rom -force-crc-match -disk-write-back -joy-left 0,0:1:0 -kbd-translate -lp-file ..\XRoar\sortida.txt
pause "press a key when XRoar has started"
m6809-gdb -ex "layout asm" -ex "layout regs" --eval-command="target remote localhost:65520"
del *.rom
and see contents of any place in memory too ...
cheers
pere
Ps. By the way, once you see the disassembled window, command 'SI' steps program line by line
Re: Xroar + GDB
Sorry for resurrecting an old thread, but I finally managed to get m6809-gdb running with XRoar 0.35 on my mac and I don't know how to make it run.
I'm stuck at the following screen: While the emulator is frozen.
How should I proceed?
I'm stuck at the following screen: While the emulator is frozen.
How should I proceed?
Re: Xroar + GDB
Hi Roberto Carlos,
not sure if this could work for you. This is the bat file I do execute to start XRoar with GDB
I execute the bat from a subfolder outside the main XRoar one, but the important here is that you just have to copy the ROMs you'd need and then call XRoar with a start command and with -gdb as the first parameter, so that you can then call m6809-gdb and execute a few commands to set up the layout of the windows and connect to XRoar
I hope the localhost will work for you, too!
cheers
pere
not sure if this could work for you. This is the bat file I do execute to start XRoar with GDB
Code: Select all
cd..
copy ..\XRoar\DOS-ROMs\dplus50.rom ddos40.rom
copy ..\XRoar\ROMs\d64rom1V31.rom d64_1.rom
copy ..\XRoar\ROMs\d64rom2V31.rom d64_2.rom
start xroar -gdb -machine dragon64 -machine-cpu 6309 -extbas d64_1.rom -altbas d64_2.rom -machine-cart dragondos -cart-rom ddos40.rom -force-crc-match -disk-write-back -joy-left 0,0:1:0 -kbd-translate -lp-file ..\XRoar\sortida.txt
pause "press a key when XRoar is running"
m6809-gdb -ex "layout asm" -ex "layout regs" --eval-command="target remote localhost:65520"
del *.rom
I hope the localhost will work for you, too!
cheers
pere
Re: Xroar + GDB
I forgot to say that once you do this, you gain control over the GDB and the XRoar stays frozen untill you issue a command
"cont" in the GDB window.
Usually you will have set one breakpoint or a watchpoint before 'cont' is issued
The GDB manual is not very user friendly but can be of help ...
cheers
pere
"cont" in the GDB window.
Usually you will have set one breakpoint or a watchpoint before 'cont' is issued
The GDB manual is not very user friendly but can be of help ...
cheers
pere
Re: Xroar + GDB
Another important point ...
IIRC you need to use a 6309 emulation or you will have problems with the '9' register
It looks like GDB 'needs' to get access to all of the registers of the 6309 CPU, so you cannot
debug a 6809 emulation or at least I am not aware of how could this be done
cheers
IIRC you need to use a 6309 emulation or you will have problems with the '9' register
It looks like GDB 'needs' to get access to all of the registers of the 6309 CPU, so you cannot
debug a 6809 emulation or at least I am not aware of how could this be done
cheers
Re: Xroar + GDB
I have a very vague recollection that when I started that patch, the "missing" registers didn't cause any issues, but later they did.
I'd say I need to distinguish between 6809 and 6309 targets, but to do the same patch against modern GDB now would mean starting from scratch anyway, and there might be a much better way...
..ciaran
I'd say I need to distinguish between 6809 and 6309 targets, but to do the same patch against modern GDB now would mean starting from scratch anyway, and there might be a much better way...
..ciaran
Re: Xroar + GDB
Hello Ciaran,sixxie wrote:I have a very vague recollection that when I started that patch, the "missing" registers didn't cause any issues, but later they did.
I'd say I need to distinguish between 6809 and 6309 targets, but to do the same patch against modern GDB now would mean starting from scratch anyway, and there might be a much better way...
..ciaran
My laptop crashed severely and my new one wears Windows10, but ... fortunately I have discovered that when I trace/debug
one of my programs that use graphics, the screen doesn't go nuts as happenend witn Windows7, instead I can see the changes / evolution
on screen, and this increases greatly the value of the XRoar-GDB combo!
I could even say that now GDB does 'always' start well instead of hanging as happened many times with W7 ...
I hope that someday you will surprise all of us with a new XRoar version even more powerful.
Please, keep on creating so wonderful tools for the 6809
cheers
pere
Re: Xroar + GDB
Thanks for your tips and patience!
I finally managed to get it working
I finally managed to get it working
Re: Xroar + GDB
cheers!
hope you enjoy the nice task of debugging
pere
hope you enjoy the nice task of debugging
pere