6502 support in GDB
S. Champailler
schampailler@skynet.be
Fri Jan 7 09:36:39 GMT 2022
Hello,
I was wondering if it is "easy" to add support for a CPU in GDB.
Specifically the 6502.
I'm mostly interested in debugging some assembly code I have written.
My use case
is : I write some assembly, compile it, run it in an emulator and use
GDB to remote
connect to that emulator and do remote debugging.
Before posting this I've checked the mailing list archives and the git
history and it seems
it has never been done before. I've read the documentation a bit and swa
one talks about
adding an architecture (wiki page of the "internals" manual). Is that
the right place to start ?
I had a few questions:
- how big an effort is it ? Are we talking about weeks, months ? I bet
months. This will
be a hobby project, so it has some chances of failing if it proves too
hard to do.
- I understand I have to write a disassembler at the very least, is that
correct ?
- I understand I have to modify the emulator to provide a GDB remote
access, correct ?
- I've checked DWARF but I still don't get how to connect my ASM source
to the actual disassembly,
does GDB provide help here ? (that is, when I'm pointing at my
assembly source code line,
I'd like to know to which instruction it corresponds in the 6502 code;
same stuff with symbols)
Best regards,
Stéphane.
More information about the Gdb
mailing list