1 |
578 |
markom |
/* Macro definitions for i386, Unix System V.
|
2 |
|
|
Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1998, 1999,
|
3 |
|
|
2000, 2001 Free Software Foundation, Inc.
|
4 |
|
|
|
5 |
|
|
This file is part of GDB.
|
6 |
|
|
|
7 |
|
|
This program is free software; you can redistribute it and/or modify
|
8 |
|
|
it under the terms of the GNU General Public License as published by
|
9 |
|
|
the Free Software Foundation; either version 2 of the License, or
|
10 |
|
|
(at your option) any later version.
|
11 |
|
|
|
12 |
|
|
This program is distributed in the hope that it will be useful,
|
13 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15 |
|
|
GNU General Public License for more details.
|
16 |
|
|
|
17 |
|
|
You should have received a copy of the GNU General Public License
|
18 |
|
|
along with this program; if not, write to the Free Software
|
19 |
|
|
Foundation, Inc., 59 Temple Place - Suite 330,
|
20 |
|
|
Boston, MA 02111-1307, USA. */
|
21 |
|
|
|
22 |
|
|
#ifndef TM_I386V_H
|
23 |
|
|
#define TM_I386V_H 1
|
24 |
|
|
|
25 |
|
|
/* First pick up the generic *86 target file. */
|
26 |
|
|
|
27 |
|
|
#include "regcache.h"
|
28 |
|
|
#include "i386/tm-i386.h"
|
29 |
|
|
|
30 |
|
|
/* Number of traps that happen between exec'ing the shell to run an
|
31 |
|
|
inferior, and when we finally get to the inferior code. This is
|
32 |
|
|
2 on most implementations. Override here to 4. */
|
33 |
|
|
|
34 |
|
|
#undef START_INFERIOR_TRAPS_EXPECTED
|
35 |
|
|
#define START_INFERIOR_TRAPS_EXPECTED 4
|
36 |
|
|
|
37 |
|
|
/* Extract from an array REGBUF containing the (raw) register state
|
38 |
|
|
a function return value of type TYPE, and copy that, in virtual format,
|
39 |
|
|
into VALBUF. */
|
40 |
|
|
|
41 |
|
|
#undef EXTRACT_RETURN_VALUE
|
42 |
|
|
#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
|
43 |
|
|
memcpy ((VALBUF), (REGBUF), TYPE_LENGTH (TYPE))
|
44 |
|
|
|
45 |
|
|
/* Write into appropriate registers a function return value
|
46 |
|
|
of type TYPE, given in virtual format. */
|
47 |
|
|
|
48 |
|
|
#undef STORE_RETURN_VALUE
|
49 |
|
|
#define STORE_RETURN_VALUE(TYPE,VALBUF) \
|
50 |
|
|
write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
|
51 |
|
|
|
52 |
|
|
|
53 |
|
|
/* Describe the pointer in each stack frame to the previous stack frame
|
54 |
|
|
(its caller). */
|
55 |
|
|
|
56 |
|
|
/* FRAME_CHAIN takes a frame's nominal address
|
57 |
|
|
and produces the frame's chain-pointer. */
|
58 |
|
|
|
59 |
|
|
#undef FRAME_CHAIN
|
60 |
|
|
#define FRAME_CHAIN(thisframe) \
|
61 |
|
|
(!inside_entry_file ((thisframe)->pc) ? \
|
62 |
|
|
read_memory_integer ((thisframe)->frame, 4) :\
|
63 |
|
|
0)
|
64 |
|
|
|
65 |
|
|
/* Define other aspects of the stack frame. */
|
66 |
|
|
|
67 |
|
|
/* A macro that tells us whether the function invocation represented
|
68 |
|
|
by FI does not have a frame on the stack associated with it. If it
|
69 |
|
|
does not, FRAMELESS is set to 1, else 0. */
|
70 |
|
|
|
71 |
|
|
#undef FRAMELESS_FUNCTION_INVOCATION
|
72 |
|
|
#define FRAMELESS_FUNCTION_INVOCATION(FI) \
|
73 |
|
|
(frameless_look_for_prologue (FI))
|
74 |
|
|
|
75 |
|
|
#undef FRAME_SAVED_PC
|
76 |
|
|
#define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 4, 4))
|
77 |
|
|
|
78 |
|
|
/* Return number of args passed to a frame.
|
79 |
|
|
Can return -1, meaning no way to tell. */
|
80 |
|
|
|
81 |
|
|
#undef FRAME_NUM_ARGS
|
82 |
|
|
#define FRAME_NUM_ARGS(fi) (-1)
|
83 |
|
|
|
84 |
|
|
#endif /* ifndef TM_I386V_H */
|