This document outlines how to port the gdb stub for xkdb to a new architecture.
-
Base your work off the pre-existing gdb stub for your architecture. These can most easily be found in the /gdb/stubs folder from the gdb source tree. Some googling can lead you to stubs for more exotic architectures.
-
Complete the following blank functions in the stub:
-
int getDebugChar()
- Read a byte from serial. Either call into XINU'skgetc
or reimplement it. -
void putDebugChar(int)
- Write a byte to serial. Either call into XINU'skputc
or reimplement it. -
void exceptionHandler (int exception_number, void *exception_address)
- Install an exception handler for a given exception number and the provided function. The easiest way to implement this is to simply call XINU'sset_evec
function.
Please look at the GDB documentation on stubs and existing stubs for further guidance.
-
-
Compile the stub into your XINU source tree following the instructions in the README and test.