]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/config/i386/tm-cygwin.h
import gdb-1999-07-07 post reformat
[thirdparty/binutils-gdb.git] / gdb / config / i386 / tm-cygwin.h
CommitLineData
c906108c
SS
1/* Macro definitions for i386 running under the win32 API Unix.
2 Copyright 1995, 1996 Free Software Foundation, Inc.
3
4 This file is part of GDB.
5
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.
10
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.
15
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
c5aa993b
JM
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
c906108c
SS
20
21
22#include "i386/tm-i386v.h"
23
24#undef MAX_REGISTER_RAW_SIZE
25#undef MAX_REGISTER_VIRTUAL_SIZE
26#undef NUM_REGS
27#undef REGISTER_BYTE
28#undef REGISTER_BYTES
29#undef REGISTER_CONVERTIBLE
30#undef REGISTER_CONVERT_TO_RAW
31#undef REGISTER_CONVERT_TO_VIRTUAL
32#undef REGISTER_NAMES
33#undef REGISTER_RAW_SIZE
34#undef REGISTER_VIRTUAL_SIZE
35#undef REGISTER_VIRTUAL_TYPE
36
37/* Number of machine registers */
38
39#define NUM_REGS 24
40
41/* Initializer for an array of names of registers.
42 There should be NUM_REGS strings in this initializer. */
43
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.
47 */
48
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)",}
55
56#define FP0_REGNUM 16
57
58/* Total amount of space needed to store our copies of the machine's
59 register state, the array `registers'. */
60
61#define REGISTER_BYTES (16 * 4 + 8 * 10)
62
63/* Index within `registers' of the first byte of the space for
64 register N. */
65
66#define REGISTER_BYTE(N) (((N) < 16) ? (N) * 4 : (((N) - 16) * 10) + (16 * 4))
67
68/* Number of bytes of storage in the actual machine representation
69 for register N. */
70
71#define REGISTER_RAW_SIZE(N) (((N) < 16) ? 4 : 10)
72
73/* Number of bytes of storage in the program's representation
74 for register N. */
75
76#define REGISTER_VIRTUAL_SIZE(N) (((N) < 16) ? 4 : 10)
77
78/* Largest value REGISTER_RAW_SIZE can have. */
79
80#define MAX_REGISTER_RAW_SIZE 10
81
82/* Largest value REGISTER_VIRTUAL_SIZE can have. */
83
84#define MAX_REGISTER_VIRTUAL_SIZE 10
85
86/* Nonzero if register N requires conversion
87 from raw format to virtual format. */
88
89#define REGISTER_CONVERTIBLE(N) \
90 ((N < FP0_REGNUM) ? 0 : 1)
91
92/* Convert data from raw format for register REGNUM in buffer FROM
93 to virtual format with type TYPE in buffer TO. */
94extern void
95i387_to_double PARAMS ((char *, char *));
96
97
98#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
99{ \
100 double val; \
101 i387_to_double ((FROM), (char *)&val); \
102 store_floating ((TO), TYPE_LENGTH (TYPE), val); \
103}
104
105extern void
106double_to_i387 PARAMS ((char *, char *));
107
108#define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \
109{ \
110 double val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \
111 double_to_i387((char *)&val, (TO)); \
112}
113
114/* Return the GDB type object for the "standard" data type
115 of data in register N. */
116
117#define REGISTER_VIRTUAL_TYPE(N) \
118 ((N < FP0_REGNUM) ? builtin_type_int : \
119 builtin_type_double)
120
c906108c
SS
121#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) skip_trampoline_code (pc, name)
122#define SKIP_TRAMPOLINE_CODE(pc) skip_trampoline_code (pc, 0)
123extern CORE_ADDR skip_trampoline_code PARAMS ((CORE_ADDR pc, char *name));
124
125extern char *cygwin_pid_to_str PARAMS ((int pid));
126#define target_pid_to_str(PID) cygwin_pid_to_str (PID)