hide random home http://www.fmi.uni-passau.de/archive/doc/unix/gdbint/gdbint_18.html (Einblicke ins Internet, 10/1995)

GDB Internals - Native Conditionals

Go to the previous, next section.

Native Conditionals

When GDB is configured and compiled, various macros are defined or left undefined, to control compilation when the host and target systems are the same. These macros should be defined (or left undefined) in `nm-system.h'.

ATTACH_DETACH
If defined, then gdb will include support for the attach and detach commands.
FETCH_INFERIOR_REGISTERS
Define this if the native-dependent code will provide its own routines fetch_inferior_registers and store_inferior_registers in `HOST-nat.c'. If this symbol is not defined, and `infptrace.c' is included in this configuration, the default routines in `infptrace.c' are used for these functions.
GET_LONGJMP_TARGET
For most machines, this is a target-dependent parameter. On the DECstation and the Iris, this is a native-dependent parameter, since <setjmp.h> is needed to define it.

This macro determines the target PC address that longjmp() will jump to, assuming that we have just stopped at a longjmp breakpoint. It takes a CORE_ADDR * as argument, and stores the target PC value through this pointer. It examines the current state of the machine as needed.

PROC_NAME_FMT
Defines the format for the name of a `/proc' device. Should be defined in `nm.h' only in order to override the default definition in `procfs.c'.
REGISTER_U_ADDR
Defines the offset of the registers in the "u area"; see section Adding a New Host.
USE_PROC_FS
This determines whether small routines in `*-tdep.c', which translate register values between GDB's internal representation and the /proc representation, are compiled.
U_REGS_OFFSET
This is the offset of the registers in the upage. It need only be defined if the generic ptrace register access routines in `infptrace.c' are being used (that is, `infptrace.c' is configured in, and FETCH_INFERIOR_REGISTERS is not defined). If the default value from `infptrace.c' is good enough, leave it undefined.

The default value means that u.u_ar0 points to the location of the registers. I'm guessing that #define U_REGS_OFFSET 0 means that u.u_ar0 is the location of the registers.

Go to the previous, next section.