This page was produced by an automated import process, and may have formatting errors; feel free to fix.
Porting GDB
Most of the work in making GDB compile on a new machine is in specifying the configuration of the machine. Porting a new architecture to GDB can be broken into a number of steps.
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 ''arch''-tdep.c.
Within ''arch''-tdep.c define the function _initialize_''arch''_tdep which calls gdbarch_register to create the new struct gdbarch for 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 [http://sourceware.org/gdb/current/onlinedocs/gdb/Configuration-Specific-Information.html#Configuration-Specific-Information Configuration Specific Information] in Debugging with GDB).