17 Porting gdb
- Ensure a bfd exists for executables of the target architecture in the bfd directory. If one does not exist, create one by modifying an existing similar one.
- Implement a disassembler for the target architecture in the opcodes directory.
- Define the target architecture in the gdb directory
(see Adding a New Target). Add the pattern
for the new target to configure.tgt with the names of the files
that contain the code. By convention the target architecture
definition for an architecture arch is placed in
Within arch-tdep.c define the function
gdbarch_registerto create the new
struct gdbarchfor the architecture.
- If a new remote target is needed, consider adding a new remote target
by defining a function
_initialize_remote_arch. However if at all possible use the gdb Remote Serial Protocol for this and implement the server side protocol independently with the target.
- If desired implement a simulator in the sim directory. This should create the library libsim.a implementing the interface in remote-sim.h (found in the include directory).
- Build and test. If desired, lobby the gdb steering group to have the new port included in the main distribution!
- Add a description of the new architecture to the main gdb user guide (see Configuration Specific Information (Debugging with gdb)).