]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/config/i386/tm-i386v.h
import gdb-1999-12-06 snapshot
[thirdparty/binutils-gdb.git] / gdb / config / i386 / tm-i386v.h
CommitLineData
c906108c
SS
1/* Macro definitions for i386, Unix System V.
2 Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
3
c5aa993b 4 This file is part of GDB.
c906108c 5
c5aa993b
JM
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.
c906108c 10
c5aa993b
JM
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.
c906108c 15
c5aa993b
JM
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. */
c906108c
SS
20
21#ifndef TM_I386V_H
22#define TM_I386V_H 1
23
24/* First pick up the generic *86 target file. */
25
26#include "i386/tm-i386.h"
27
28/* Number of traps that happen between exec'ing the shell to run an
29 inferior, and when we finally get to the inferior code. This is
30 2 on most implementations. Override here to 4. */
31
32#undef START_INFERIOR_TRAPS_EXPECTED
33#define START_INFERIOR_TRAPS_EXPECTED 4
34
c906108c
SS
35#undef STORE_STRUCT_RETURN
36#define STORE_STRUCT_RETURN(ADDR, SP) \
37 { char buf[REGISTER_SIZE]; \
38 (SP) -= sizeof (ADDR); \
39 store_address (buf, sizeof (ADDR), ADDR); \
40 write_memory ((SP), buf, sizeof (ADDR)); }
41
42/* Extract from an array REGBUF containing the (raw) register state
43 a function return value of type TYPE, and copy that, in virtual format,
44 into VALBUF. */
45
46#undef EXTRACT_RETURN_VALUE
47#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
48 memcpy ((VALBUF), (REGBUF), TYPE_LENGTH (TYPE))
49
50/* Write into appropriate registers a function return value
51 of type TYPE, given in virtual format. */
52
53#undef STORE_RETURN_VALUE
54#define STORE_RETURN_VALUE(TYPE,VALBUF) \
55 write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
c906108c 56\f
c5aa993b 57
c906108c
SS
58/* Describe the pointer in each stack frame to the previous stack frame
59 (its caller). */
60
61/* FRAME_CHAIN takes a frame's nominal address
62 and produces the frame's chain-pointer. */
63
64#undef FRAME_CHAIN
65#define FRAME_CHAIN(thisframe) \
66 (!inside_entry_file ((thisframe)->pc) ? \
67 read_memory_integer ((thisframe)->frame, 4) :\
68 0)
69
70/* Define other aspects of the stack frame. */
71
72/* A macro that tells us whether the function invocation represented
73 by FI does not have a frame on the stack associated with it. If it
74 does not, FRAMELESS is set to 1, else 0. */
75
76#undef FRAMELESS_FUNCTION_INVOCATION
392a587b
JM
77#define FRAMELESS_FUNCTION_INVOCATION(FI) \
78 (frameless_look_for_prologue (FI))
c906108c
SS
79
80#undef FRAME_SAVED_PC
81#define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 4, 4))
82
83/* Return number of args passed to a frame.
84 Can return -1, meaning no way to tell. */
85
86#undef FRAME_NUM_ARGS
392a587b 87#define FRAME_NUM_ARGS(fi) (-1)
c906108c 88
104c1213 89/* Forward decl's for prototypes */
c906108c
SS
90struct frame_info;
91struct frame_saved_regs;
c906108c
SS
92
93extern int
94i386_frame_num_args PARAMS ((struct frame_info *));
95
c5aa993b 96#endif /* ifndef TM_I386V_H */