1 /* Macro definitions for i386 running under the win32 API Unix.
2 Copyright 1995, 1996 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
22 #include "i386/tm-i386v.h"
24 #undef MAX_REGISTER_RAW_SIZE
25 #undef MAX_REGISTER_VIRTUAL_SIZE
29 #undef REGISTER_CONVERTIBLE
30 #undef REGISTER_CONVERT_TO_RAW
31 #undef REGISTER_CONVERT_TO_VIRTUAL
33 #undef REGISTER_RAW_SIZE
34 #undef REGISTER_VIRTUAL_SIZE
35 #undef REGISTER_VIRTUAL_TYPE
37 /* Number of machine registers */
41 /* Initializer for an array of names of registers.
42 There should be NUM_REGS strings in this initializer. */
44 /* the order of the first 8 registers must match the compiler's
45 * numbering scheme (which is the same as the 386 scheme)
46 * also, this table must match regmap in i386-pinsn.c.
49 #define REGISTER_NAMES { "eax", "ecx", "edx", "ebx", \
50 "esp", "ebp", "esi", "edi", \
51 "eip", "ps", "cs", "ss", \
52 "ds", "es", "fs", "gs", \
53 "st", "st(1)","st(2)","st(3)",\
54 "st(4)","st(5)","st(6)","st(7)",}
58 /* Total amount of space needed to store our copies of the machine's
59 register state, the array `registers'. */
61 #define REGISTER_BYTES (16 * 4 + 8 * 10)
63 /* Index within `registers' of the first byte of the space for
66 #define REGISTER_BYTE(N) (((N) < 16) ? (N) * 4 : (((N) - 16) * 10) + (16 * 4))
68 /* Number of bytes of storage in the actual machine representation
71 #define REGISTER_RAW_SIZE(N) (((N) < 16) ? 4 : 10)
73 /* Number of bytes of storage in the program's representation
76 #define REGISTER_VIRTUAL_SIZE(N) (((N) < 16) ? 4 : 10)
78 /* Largest value REGISTER_RAW_SIZE can have. */
80 #define MAX_REGISTER_RAW_SIZE 10
82 /* Largest value REGISTER_VIRTUAL_SIZE can have. */
84 #define MAX_REGISTER_VIRTUAL_SIZE 10
86 /* Nonzero if register N requires conversion
87 from raw format to virtual format. */
89 #define REGISTER_CONVERTIBLE(N) \
90 ((N < FP0_REGNUM) ? 0 : 1)
92 /* Convert data from raw format for register REGNUM in buffer FROM
93 to virtual format with type TYPE in buffer TO. */
95 i387_to_double
PARAMS ((char *, char *));
98 #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
101 i387_to_double ((FROM), (char *)&val); \
102 store_floating ((TO), TYPE_LENGTH (TYPE), val); \
106 double_to_i387
PARAMS ((char *, char *));
108 #define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \
110 double val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \
111 double_to_i387((char *)&val, (TO)); \
114 /* Return the GDB type object for the "standard" data type
115 of data in register N. */
117 #define REGISTER_VIRTUAL_TYPE(N) \
118 ((N < FP0_REGNUM) ? builtin_type_int : \
121 #define IN_SOLIB_CALL_TRAMPOLINE(pc, name) skip_trampoline_code (pc, name)
122 #define SKIP_TRAMPOLINE_CODE(pc) skip_trampoline_code (pc, 0)
123 extern CORE_ADDR skip_trampoline_code
PARAMS ((CORE_ADDR pc
, char *name
));
125 extern char *cygwin_pid_to_str
PARAMS ((int pid
));
126 #define target_pid_to_str(PID) cygwin_pid_to_str (PID)