diff options
Diffstat (limited to 'gdb/defs.h')
-rw-r--r-- | gdb/defs.h | 78 |
1 files changed, 77 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* Basic definitions for GDB, the GNU debugger. +/* Basic, host-specific, and target-specific definitions for GDB. Copyright (C) 1986, 1989, 1991 Free Software Foundation, Inc. This file is part of GDB. @@ -69,6 +69,7 @@ extern int parse_escape (); extern char *reg_names[]; /* Indicate that these routines do not return to the caller. */ extern volatile void error(), fatal(); +extern void warning_setup(), warning(); /* Various possibilities for alloca. */ #ifndef alloca @@ -274,6 +275,7 @@ enum language language_unknown, /* Language not known */ language_auto, /* Placeholder for automatic setting */ language_c, /* C */ + language_cplus, /* C++ */ language_m2, /* Modula-2 */ }; @@ -292,5 +294,79 @@ char *local_hex_format_custom(); /* language.c */ char *local_hex_string (); /* language.c */ char *local_hex_string_custom (); /* language.c */ + +/* System-dependent parameters for GDB. + + The standard thing is to include defs.h. However, files that are + specific to a particular target can define TM_FILE_OVERRIDE before + including defs.h, then can include any particular tm-file they desire. */ + +/* Target machine definition. This will be a symlink to one of the + tm-*.h files, built by the `configure' script. */ + +#ifndef TM_FILE_OVERRIDE +#include "tm.h" +#endif + +/* Host machine definition. This will be a symlink to one of the + xm-*.h files, built by the `configure' script. */ + +#include "xm.h" + +/* TARGET_BYTE_ORDER and HOST_BYTE_ORDER should be defined to one of these. */ +#if !defined (BIG_ENDIAN) +#define BIG_ENDIAN 4321 +#endif + +#if !defined (LITTLE_ENDIAN) +#define LITTLE_ENDIAN 1234 +#endif + +/* The bit byte-order has to do just with numbering of bits in + debugging symbols and such. Conceptually, it's quite separate + from byte/word byte order. */ + +#if !defined (BITS_BIG_ENDIAN) +#if TARGET_BYTE_ORDER == BIG_ENDIAN +#define BITS_BIG_ENDIAN 1 +#endif /* Big endian. */ + +#if TARGET_BYTE_ORDER == LITTLE_ENDIAN +#define BITS_BIG_ENDIAN 0 +#endif /* Little endian. */ +#endif /* BITS_BIG_ENDIAN not defined. */ + +/* Swap LEN bytes at BUFFER between target and host byte-order. */ +#if TARGET_BYTE_ORDER == HOST_BYTE_ORDER +#define SWAP_TARGET_AND_HOST(buffer,len) +#else /* Target and host byte order differ. */ +#define SWAP_TARGET_AND_HOST(buffer,len) \ + { \ + char tmp; \ + char *p = (char *)(buffer); \ + char *q = ((char *)(buffer)) + len - 1; \ + for (; p < q; p++, q--) \ + { \ + tmp = *q; \ + *q = *p; \ + *p = tmp; \ + } \ + } +#endif /* Target and host byte order differ. */ + +/* On some machines there are bits in addresses which are not really + part of the address, but are used by the kernel, the hardware, etc. + for special purposes. ADDR_BITS_REMOVE takes out any such bits + so we get a "real" address such as one would find in a symbol + table. ADDR_BITS_SET sets those bits the way the system wants + them. */ +#if !defined (ADDR_BITS_REMOVE) +#define ADDR_BITS_REMOVE(addr) (addr) +#define ADDR_BITS_SET(addr) (addr) +#endif /* No ADDR_BITS_REMOVE. */ + +#if !defined (SYS_SIGLIST_MISSING) +#define SYS_SIGLIST_MISSING defined (USG) +#endif /* No SYS_SIGLIST_MISSING */ #endif /* no DEFS_H */ |