diff options
author | Fred Fish <fnf@specifix.com> | 1995-11-02 15:20:50 +0000 |
---|---|---|
committer | Fred Fish <fnf@specifix.com> | 1995-11-02 15:20:50 +0000 |
commit | 7ee7dc27b0a8283399607e7efce8a46a6565fc8c (patch) | |
tree | b18f4e93d6acecb50a8e294bdf46f1bb97b5d0c1 /gdb/config/i386/tm-symmetry.h | |
parent | 7ff82a593d27021de66f0043c1edb66e5a051481 (diff) | |
download | gdb-7ee7dc27b0a8283399607e7efce8a46a6565fc8c.zip gdb-7ee7dc27b0a8283399607e7efce8a46a6565fc8c.tar.gz gdb-7ee7dc27b0a8283399607e7efce8a46a6565fc8c.tar.bz2 |
* config/i386/tm-i386.h: New file containing generic i*86 target
definitions.
(TARGET_BYTE_ORDER): Moved here from tm-i386v.h.
(IEEE_FLOAT): Moved here from tm-i386v.h.
(START_INFERIOR_TRAPS_EXPECTED): Define default as 2.
(FUNCTION_START_OFFSET): Moved here from tm-i386v.h.
(SKIP_PROLOGUE): Moved here from tm-i386v.h.
(SAVED_PC_AFTER_CALL): Moved here from tm-i386v.h.
(INNER_THAN): Moved here from tm-i386v.h.
(BREAKPOINT): Moved here from tm-i386v.h.
(DECR_PC_AFTER_BREAK): Moved here from tm-i386v.h.
(ABOUT_TO_RETURN): Moved here from tm-i386v.h.
(REGISTER_SIZE): Moved here from tm-i386v.h.
(NUM_REGS): Moved here from tm-i386v.h.
(REGISTER_NAMES): Moved here from tm-i386v.h.
(EXTRACT_STRUCT_VALUE_ADDRESS): Moved here from tm-i386v.h.
(FP_REGNUM): Moved here from tm-i386v.h.
(SP_REGNUM): Moved here from tm-i386v.h.
(PC_REGNUM): Moved here from tm-i386v.h.
(PS_REGNUM): Moved here from tm-i386v.h.
(FP0_REGNUM): Moved here from tm-i386aix.h.
(FPC_REGNUM): Moved here from tm-sun386.h.
(REGISTER_BYTES): Moved here from tm-i386aix.h.
(REGISTER_BYTE): Moved here from tm-i386aix.h.
(REGISTER_RAW_SIZE): Moved here from tm-i386aix.h.
(MAX_REGISTER_RAW_SIZE): Moved here from tm-i386aix.h.
(REGISTER_VIRTUAL_SIZE): Moved here from tm-i386aix.h.
(MAX_REGISTER_VIRTUAL_SIZE): Moved here from tm-i386aix.h.
(EXTRACT_RETURN_VALUE): Moved here from tm-i386aix.h.
(STORE_RETURN_VALUE): Moved here from tm-i386aix.h.
(REGISTER_VIRTUAL_TYPE): Moved here from tm-i386v.h.
(STORE_STRUCT_RETURN): Moved here from tm-i386v.h.
(FRAME_CHAIN): Moved here from tm-i386v4.h.
(FRAMELESS_FUNCTION_INVOCATION): Moved here from tm-i386v4.h.
(FRAME_SAVED_PC): Moved here from tm-i386os9k.h
(FRAME_ARGS_ADDRESS): Moved here from tm-i386v.h.
(FRAME_LOCALS_ADDRESS): Moved here from tm-i386v.h.
(FRAME_NUM_ARGS): Moved here from tm-i386sun.h.
(FRAME_ARGS_SKIP): Moved here from tm-i386v.h.
(FRAME_FIND_SAVED_REGS): Moved here from tm-i386v.h.
(PUSH_DUMMY_FRAME): Moved here from tm-i386v.h.
(POP_FRAME): Moved here from tm-i386v.h.
(CALL_DUMMY, CALL_DUMMY_LENGTH, CALL_DUMMY_START_OFFSET,
CALL_DUMMY_BREAKPOINT_OFFSET, FIX_CALL_DUMMY): Moved here from
tm-i386v.h
(print_387_control_word, print_387_status_word): Declare prototypes.
(struct frame_info, struct frame_saved_regs): Forward decls for
prototypes.
(SP_ARG0): Moved here from tm-i386v.h.
* config/i386/tm-i386v.h:
(i386/tm-i386.h): Include.
(TARGET_BYTE_ORDER): Remove.
(IEEE_FLOAT): Remove.
(START_INFERIOR_TRAPS_EXPECTED): Undef before redefine to 4.
(FUNCTION_START_OFFSET): Remove.
(SKIP_PROLOGUE): Remove.
(i386_skip_prologue): Remove prototype.
(SAVED_PC_AFTER_CALL): Remove.
(INNER_THAN): Remove.
(BREAKPOINT): Remove.
(DECR_PC_AFTER_BREAK): Remove.
(ABOUT_TO_RETURN): Remove.
(REGISTER_SIZE): Remove.
(NUM_REGS): Undef before redefine to 16 (no FP support).
(REGISTER_NAMES): Undef before redefine.
(FP_REGNUM, SP_REGNUM, PC_REGNUM, PS_REGNUM): Remove.
(REGISTER_BYTES): Undef before redefine.
(REGISTER_BYTE): Undef before redefine.
(REGISTER_RAW_SIZE): Undef before redefine.
(REGISTER_VIRTUAL_SIZE): Undef before redefine.
(MAX_REGISTER_RAW_SIZE): Undef before redefine.
(MAX_REGISTER_VIRTUAL_SIZE): Undef before redefine.
(REGISTER_VIRTUAL_TYPE): Undef before redefine.
(STORE_STRUCT_RETURN): Undef before redefine.
(EXTRACT_RETURN_VALUE): Undef before redefine.
(STORE_RETURN_VALUE): Undef before redefine.
(EXTRACT_STRUCT_VALUE_ADDRESS): Remove.
(FRAME_CHAIN): Undef before redefine.
(FRAMELESS_FUNCTION_INVOCATION): Undef before redefine.
(FRAME_SAVED_PC): Undef before redefine.
(FRAME_ARGS_ADDRESS): Remove.
(FRAME_LOCALS_ADDRESS): Remove.
(FRAME_NUM_ARGS): Undef before redefine.
(FRAME_ARGS_SKIP): Remove.
(FRAME_FIND_SAVED_REGS): Remove.
(PUSH_DUMMY_FRAME): Remove.
(POP_FRAME): Remove.
(CALL_DUMMY): Remove.
(CALL_DUMMY_LENGTH): Remove.
(CALL_DUMMY_START_OFFSET): Remove.
(CALL_DUMMY_BREAKPOINT_OFFSET): Remove
(FIX_CALL_DUMMY): Remove.
(print_387_control_word): Remove.
(print_387_status_word): Remove.
(SP_ARG0): Remove.
* config/i386/tm-symmetry.h:
(TM_SYMMETRY_H): Enclose file in test for define & define if needed.
(START_INFERIOR_TRAPS_EXPECTED): Move to after inclusion of
tm-i386v4.h or tm-i386v.h, #undef, and #define back to 2.
(DECR_PC_AFTER_BREAK): Move to after inclusion of tm-i386v4.h
or tm-i386v.h, #undef, and #define to 0.
(MAX_REGISTER_RAW_SIZE): Remove.
(FRAME_CHAIN): Remove.
(FRAMELESS_FUNCTION_INVOCATION): Remove.
(FRAME_SAVED_PC): Remove.
(print_387_control_word, print_387_status_word): Remove prototypes.
* config/i386/tm-ptx.h:
(TM_PTX_H): Enclose file in test for define & define if needed.
(START_INFERIOR_TRAPS_EXPECTED): Move to after inclusion of
tm-i386v4.h or tm-i386v.h, #undef, and #define back to 2.
(DECR_PC_AFTER_BREAK): Move to after inclusion of tm-i386v4.h
or tm-i386v.h, #undef, and #define to 0.
(SDB_REG_TO_REGNUM): Remove obsolete commented out define.
(print_387_control_word, print_387_status_word): Remove prototypes.
* config/i386/tm-linux.h:
(TM_LINUX_H): Enclose file in test for define & define if needed.
(i386/tm-i386.h): Include instead of tm-i386v.h.
(START_INFERIOR_TRAPS_EXPECTED): Remove.
* config/i386/tm-i386v4.h:
(TM_I386V4_H): Enclose file in test for define & define if needed.
(i386/tm-i386.h): Include instead of tm-i386v.h.
(START_INFERIOR_TRAPS_EXPECTED): Remove.
(FRAME_CHAIN): Moved to tm-i386.h.
(FRAMELESS_FUNCTION_INVOCATION): Moved to tm-i386.h.
(FRAME_SAVED_PC): Remove.
(sigtramp_saved_pc): Define as i386v4_sigtramp_saved_pc.
(FRAME_NUM_ARGS): Remove.
* config/i386/tm-i386os9k.h:
(TM_I386OS9K_H): Enclose file in test for define & define if needed.
(i386/tm-i386.h): Include instead of tm-i386v.h.
(START_INFERIOR_TRAPS_EXPECTED): Remove.
(NUM_REGS): Undefine before redefining.
(FRAME_CHAIN): Remove.
(FRAMELESS_FUNCTION_INVOCATION): Remove.
(FRAME_SAVED_PC): Move to tm-i386.h.
* config/i386/tm-i386nw.h:
(TM_I386NW_H): Enclose file in test for define & define if needed.
(i386/tm-i386.h): Include instead of tm-i386v.h.
(START_INFERIOR_TRAPS_EXPECTED): Remove.
* config/i386/tm-i386bsd.h:
(TM_I386BSD_H): Enclose file in test for define & define if needed.
(i386/tm-i386.h): Include instead of tm-i386v.h.
(START_INFERIOR_TRAPS_EXPECTED): Remove.
(FRAMELESS_FUNCTION_INVOCATION): Remove.
(FRAME_SAVED_PC): Remove.
* config/i386/tm-i386aix.h:
(i386/tm-i386.h): Include instead of tm-i386v.h.
(START_INFERIOR_TRAPS_EXPECTED): Remove.
(FP_REGNUM): Remove.
(SP_REGNUM): Remove.
(PC_REGNUM): Remove.
(PS_REGNUM): Remove.
(FP0_REGNUM): Moved to tm-i386.h.
(NUM_REGS): Remove.
(REGISTER_NAMES): Remove.
(REGISTER_BYTES): Moved to tm-i386.h.
(REGISTER_BYTE): Moved to tm-i386.h.
(REGISTER_RAW_SIZE): Moved to tm-i386.h.
(MAX_REGISTER_RAW_SIZE): Moved to tm-i386.h.
(REGISTER_VIRTUAL_SIZE): Moved to tm-i386.h.
(REGISTER_VIRTUAL_TYPE): Removed.
(EXTRACT_RETURN_VALUE): Moved to tm-i386.h.
(STORE_RETURN_VALUE): Moved to tm-i386.h.
* config/i386/tm-sun386.h:
(TM_SUN386_H): Enclose file in test for define & define if needed.
(i386/tm-i386.h): Include.
(TARGET_BYTE_ORDER): Remove.
(FUNCTION_START_OFFSET): Remove.
(SKIP_PROLOGUE): Remove.
(SAVED_PC_AFTER_CALL): Remove.
(INNER_THAN): Remove.
(BREAKPOINT): Remove.
(DECR_PC_AFTER_BREAK): Remove.
(ABOUT_TO_RETURN): Remove.
(REGISTER_SIZE): Remove.
(NUM_REGS): Undefine before defining.
(REGISTER_NAMES): Undefine before redefining.
(REGISTER_BYTES): Undefine before redefining.
(REGISTER_BYTE): Undefine before defining.
(FP_REGNUM): Undefine before defining.
(PC_REGNUM): Undefine before defining.
(FPC_REGNUM): Undefine before defining.
(REGISTER_RAW_SIZE): Undefine before defining.
(FRAME_CHAIN): Undefine before defining.
(FRAMELESS_FUNCTION_INVOCATION): Undefine before defining.
(FRAME_SAVED_PC): Undefine before defining.
(FRAME_NUM_ARGS): Moved to tm-i386.h.
(MAX_REGISTER_RAW_SIZE): Remove.
(MAX_REGISTER_VIRTUAL_SIZE): Remove.
(STORE_STRUCT_RETURN): Remove.
(EXTRACT_STRUCT_VALUE_ADDRESS): Remove.
(FRAME_ARGS_ADDRESS): Remove.
(FRAME_LOCALS_ADDRESS): Remove.
(FRAME_NUM_ARGS): Undefine before defining.
(FRAME_ARGS_SKIP): Remove.
(FRAME_FIND_SAVED_REGS): Remove.
(PUSH_DUMMY_FRAME): Remove.
(POP_FRAME): Remove.
(CALL_DUMMY, CALL_DUMMY_LENGTH, CALL_DUMMY_START_OFFSET): Remove.
(struct frame_info, struct frame_saved_regs): Remove forward decls
for prototypes.
* config/i386/tm-i386lynx.h (i386/tm-i386.h): Include instead of
tm-i386v.h.
* config/i386/tm-i386m3.h (i386/tm-i386.h): Include instead of
tm-i386v.h.
Diffstat (limited to 'gdb/config/i386/tm-symmetry.h')
-rw-r--r-- | gdb/config/i386/tm-symmetry.h | 155 |
1 files changed, 60 insertions, 95 deletions
diff --git a/gdb/config/i386/tm-symmetry.h b/gdb/config/i386/tm-symmetry.h index b66b193..11931d4 100644 --- a/gdb/config/i386/tm-symmetry.h +++ b/gdb/config/i386/tm-symmetry.h @@ -20,20 +20,24 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef TM_SYMMETRY_H +#define TM_SYMMETRY_H 1 + /* I don't know if this will work for cross-debugging, even if you do get a copy of the right include file. */ #include <machine/reg.h> +#include "i386/tm-i386v.h" + +#undef START_INFERIOR_TRAPS_EXPECTED #define START_INFERIOR_TRAPS_EXPECTED 2 -/* Amount PC must be decremented by after a breakpoint. - This is often the number of bytes in BREAKPOINT - but not always. */ +/* Amount PC must be decremented by after a breakpoint. This is often the + number of bytes in BREAKPOINT but not always (such as now). */ +#undef DECR_PC_AFTER_BREAK #define DECR_PC_AFTER_BREAK 0 -#include "i386/tm-i386v.h" - #if 0 /* --- this code can't be used unless we know we are running native, since it uses host specific ptrace calls. */ @@ -44,29 +48,31 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #endif /* Number of machine registers */ + #undef NUM_REGS #define NUM_REGS 49 /* Initializer for an array of names of registers. There should be NUM_REGS strings in this initializer. */ -/* Symmetry registers are in this weird order to match the register - numbers in the symbol table entries. If you change the order, - things will probably break mysteriously for no apparent reason. - Also note that the st(0)...st(7) 387 registers are represented as - st0...st7. */ - -#undef REGISTER_NAMES -#define REGISTER_NAMES { "eax", "edx", "ecx", "st0", "st1", \ - "ebx", "esi", "edi", "st2", "st3", \ - "st4", "st5", "st6", "st7", "esp", \ - "ebp", "eip", "eflags", "fp1", "fp2", \ - "fp3", "fp4", "fp5", "fp6", "fp7", \ - "fp8", "fp9", "fp10", "fp11", "fp12", \ - "fp13", "fp14", "fp15", "fp16", "fp17", \ - "fp18", "fp19", "fp20", "fp21", "fp22", \ - "fp23", "fp24", "fp25", "fp26", "fp27", \ - "fp28", "fp29", "fp30", "fp31" } +/* Initializer for an array of names of registers. There should be at least + NUM_REGS strings in this initializer. Any excess ones are simply ignored. + Symmetry registers are in this weird order to match the register numbers + in the symbol table entries. If you change the order, things will probably + break mysteriously for no apparent reason. Also note that the st(0)... + st(7) 387 registers are represented as st0...st7. */ + +#undef REGISTER_NAMES +#define REGISTER_NAMES { "eax", "edx", "ecx", "st0", "st1", \ + "ebx", "esi", "edi", "st2", "st3", \ + "st4", "st5", "st6", "st7", "esp", \ + "ebp", "eip", "eflags","fp1", "fp2", \ + "fp3", "fp4", "fp5", "fp6", "fp7", \ + "fp8", "fp9", "fp10", "fp11", "fp12", \ + "fp13", "fp14", "fp15", "fp16", "fp17", \ + "fp18", "fp19", "fp20", "fp21", "fp22", \ + "fp23", "fp24", "fp25", "fp26", "fp27", \ + "fp28", "fp29", "fp30", "fp31" } /* Register numbers of various important registers. Note that some of these values are "real" register numbers, @@ -94,17 +100,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define FP1_REGNUM 18 /* first 1167 register */ /* Get %fp2 - %fp31 by addition, since they are contiguous */ -#undef SP_REGNUM -#define SP_REGNUM 14 /* esp--Contains address of top of stack */ +#undef SP_REGNUM +#define SP_REGNUM 14 /* (usp) Contains address of top of stack */ #define ESP_REGNUM 14 -#undef FP_REGNUM -#define FP_REGNUM 15 /* ebp--Contains address of executing stack frame */ +#undef FP_REGNUM +#define FP_REGNUM 15 /* (ebp) Contains address of executing stack frame */ #define EBP_REGNUM 15 -#undef PC_REGNUM -#define PC_REGNUM 16 /* eip--Contains program counter */ +#undef PC_REGNUM +#define PC_REGNUM 16 /* (eip) Contains program counter */ #define EIP_REGNUM 16 -#undef PS_REGNUM -#define PS_REGNUM 17 /* eflags--Contains processor status */ +#undef PS_REGNUM +#define PS_REGNUM 17 /* (ps) Contains processor status */ #define EFLAGS_REGNUM 17 /* @@ -209,49 +215,45 @@ switch (regno) { \ } /* Total amount of space needed to store our copies of the machine's - register state, the array `registers'. */ -/* 10 i386 registers, 8 i387 registers, and 31 Weitek 1167 registers */ -#undef REGISTER_BYTES + register state, the array `registers'. 10 i*86 registers, 8 i387 + registers, and 31 Weitek 1167 registers */ + +#undef REGISTER_BYTES #define REGISTER_BYTES ((10 * 4) + (8 * 10) + (31 * 4)) /* Index within `registers' of the first byte of the space for register N. */ -#undef REGISTER_BYTE +#undef REGISTER_BYTE #define REGISTER_BYTE(N) \ -((N < 3) ? (N * 4) : \ -(N < 5) ? (((N - 2) * 10) + 2) : \ -(N < 8) ? (((N - 5) * 4) + 32) : \ -(N < 14) ? (((N - 8) * 10) + 44) : \ - (((N - 14) * 4) + 104)) +(((N) < 3) ? ((N) * 4) : \ +((N) < 5) ? ((((N) - 2) * 10) + 2) : \ +((N) < 8) ? ((((N) - 5) * 4) + 32) : \ +((N) < 14) ? ((((N) - 8) * 10) + 44) : \ + ((((N) - 14) * 4) + 104)) /* Number of bytes of storage in the actual machine representation * for register N. All registers are 4 bytes, except 387 st(0) - st(7), * which are 80 bits each. */ -#undef REGISTER_RAW_SIZE +#undef REGISTER_RAW_SIZE #define REGISTER_RAW_SIZE(N) \ -((N < 3) ? 4 : \ -(N < 5) ? 10 : \ -(N < 8) ? 4 : \ -(N < 14) ? 10 : \ +(((N) < 3) ? 4 : \ +((N) < 5) ? 10 : \ +((N) < 8) ? 4 : \ +((N) < 14) ? 10 : \ 4) -/* Largest value REGISTER_RAW_SIZE can have. */ - -#undef MAX_REGISTER_RAW_SIZE -#define MAX_REGISTER_RAW_SIZE 10 - /* Nonzero if register N requires conversion from raw format to virtual format. */ -#undef REGISTER_CONVERTIBLE +#undef REGISTER_CONVERTIBLE #define REGISTER_CONVERTIBLE(N) \ -((N < 3) ? 0 : \ -(N < 5) ? 1 : \ -(N < 8) ? 0 : \ -(N < 14) ? 1 : \ +(((N) < 3) ? 0 : \ +((N) < 5) ? 1 : \ +((N) < 8) ? 0 : \ +((N) < 14) ? 1 : \ 0) #include "floatformat.h" @@ -294,24 +296,17 @@ switch (regno) { \ passes it on the stack. gcc should be fixed in future versions to adopt native cc conventions. */ -#undef STORE_STRUCT_RETURN +#undef STORE_STRUCT_RETURN #define STORE_STRUCT_RETURN(ADDR, SP) write_register(0, (ADDR)) /* Extract from an array REGBUF containing the (raw) register state a function return value of type TYPE, and copy that, in virtual format, into VALBUF. */ -#undef EXTRACT_RETURN_VALUE +#undef EXTRACT_RETURN_VALUE #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ symmetry_extract_return_value(TYPE, REGBUF, VALBUF) - -extern void -print_387_control_word PARAMS ((unsigned int)); - -extern void -print_387_status_word PARAMS ((unsigned int)); - /* The following redefines make backtracing through sigtramp work. They manufacture a fake sigtramp frame and obtain the saved pc in sigtramp from the sigcontext structure which is pushed by the kernel on the @@ -322,35 +317,5 @@ print_387_status_word PARAMS ((unsigned int)); /* Offset to saved PC in sigcontext, from <signal.h>. */ #define SIGCONTEXT_PC_OFFSET 16 -/* FRAME_CHAIN takes a frame's nominal address and produces the frame's - chain-pointer. - In the case of the i386, the frame's nominal address - is the address of a 4-byte word containing the calling frame's address. */ -#undef FRAME_CHAIN -#define FRAME_CHAIN(thisframe) \ - (thisframe->signal_handler_caller \ - ? thisframe->frame \ - : (!inside_entry_file ((thisframe)->pc) \ - ? read_memory_integer ((thisframe)->frame, 4) \ - : 0)) - -/* A macro that tells us whether the function invocation represented - by FI does not have a frame on the stack associated with it. If it - does not, FRAMELESS is set to 1, else 0. */ -#undef FRAMELESS_FUNCTION_INVOCATION -#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \ - do { \ - if ((FI)->signal_handler_caller) \ - (FRAMELESS) = 0; \ - else \ - (FRAMELESS) = frameless_look_for_prologue(FI); \ - } while (0) - -/* Saved Pc. Get it from sigcontext if within sigtramp. */ - -#undef FRAME_SAVED_PC -#define FRAME_SAVED_PC(FRAME) \ - (((FRAME)->signal_handler_caller \ - ? sigtramp_saved_pc (FRAME) \ - : read_memory_integer ((FRAME)->frame + 4, 4)) \ - ) +#endif /* ifndef TM_SYMMETRY_H */ + |