#44392 - herrjones - Wed Jun 01, 2005 7:20 am
Hello all,
Please 'tell me if I am crazy or not, or if what I will write about is possible or not.
Since it seems there is no debugging possibility for code on the (GBA) target (don't know for the DS), I've seen a few questions on a software debugging stub to connect to GDB (the GDB remote protocol). I've been writing such a thing in the past for my ARM7TDMI project board (from Atmel, with a JTAG interface), but since a few other people were working on the same, I gave up and used their code.
The idea is to let the stub do all the work on the host (the PC/laptop/ whatever) and to let that stub communicate with a much smaller stub on the GBA (the target) (via the multiboot cable). So the stub on the GBA should be able to replace the instruction at a certain address with a jump instruction to the debugging routine, or a SWI instruction. This has then to be communicated with the debugger on host. This - I think - is a reachable goal, the more I already got part of the code.
Next thing to think about is how to implement/include it in code. There are 2 different approaches:
1) make a small ROM with the stub code in it, able to place and replace code at a certain address in memory (to start with, let's only talk about RAM). The stub is then able to accept incoming code and fill up the memory (download the code to debug directly in memory).
2) include the whole stub code into your new project you want to debug (via a few #defines, so you can easily leave it out in the final project).
The general idea is to just install an interrupt for the communication channel in UART mode (interaction with the host) and let the actual stub code be in FIQ mode (or another privileged mode).
Could someone give some comments on this one?
Kind regards,
Jan
Please 'tell me if I am crazy or not, or if what I will write about is possible or not.
Since it seems there is no debugging possibility for code on the (GBA) target (don't know for the DS), I've seen a few questions on a software debugging stub to connect to GDB (the GDB remote protocol). I've been writing such a thing in the past for my ARM7TDMI project board (from Atmel, with a JTAG interface), but since a few other people were working on the same, I gave up and used their code.
The idea is to let the stub do all the work on the host (the PC/laptop/ whatever) and to let that stub communicate with a much smaller stub on the GBA (the target) (via the multiboot cable). So the stub on the GBA should be able to replace the instruction at a certain address with a jump instruction to the debugging routine, or a SWI instruction. This has then to be communicated with the debugger on host. This - I think - is a reachable goal, the more I already got part of the code.
Next thing to think about is how to implement/include it in code. There are 2 different approaches:
1) make a small ROM with the stub code in it, able to place and replace code at a certain address in memory (to start with, let's only talk about RAM). The stub is then able to accept incoming code and fill up the memory (download the code to debug directly in memory).
2) include the whole stub code into your new project you want to debug (via a few #defines, so you can easily leave it out in the final project).
The general idea is to just install an interrupt for the communication channel in UART mode (interaction with the host) and let the actual stub code be in FIQ mode (or another privileged mode).
Could someone give some comments on this one?
Kind regards,
Jan