11.11 Adding a New Target
- Contains any miscellaneous code required for this target machine. On
some machines it doesn't exist at all.
- This is required to describe the basic layout of the target machine's processor chip (registers, stack, etc.). It can be shared among many targets that use the same processor architecture.
(Target header files such as gdb/config/arch/tm-ttt.h, gdb/config/arch/tm-arch.h, and config/tm-os.h are no longer used.)
A gdb description for a new architecture, arch is created by
defining a global function
convention in the source file arch-tdep.c. For
example, in the case of the OpenRISC 1000, this function is called
_initialize_or1k_tdep and is found in the file
The object file resulting from compiling this source file, which will
contain the implementation of the
_tdep function is specified in the
gdb configure.tgt file, which includes a large case
statement pattern matching against the
--target option of the
Note: If the architecture requires multiple source files, the corresponding binaries should be included in configure.tgt. However if there are header files, the dependencies on these will not be picked up from the entries in configure.tgt. The Makefile.in file will need extending to show these dependencies.
void gdbarch_register (enum bfd_architecture architecture, gdbarch_init_ftype *init_func, gdbarch_dump_tdep_ftype *tdep_dump_func);
This function has been described fully in an earlier section. See How an Architecture is Represented.
struct gdbarch should contain implementations of
the necessary functions (described in the previous sections) to
describe the basic layout of the target machine's processor chip
(registers, stack, etc.). It can be shared among many targets that use
the same processor architecture.