/* Macro definitions for GDB on an Intel i[345]86.
- Copyright (C) 1995 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996 Free Software Foundation, Inc.
This file is part of GDB.
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef TM_I386_H
#define TM_I386_H 1
/* Advance PC across any function entry prologue instructions to reach some
"real" code. */
-#define SKIP_PROLOGUE(frompc) {(frompc) = i386_skip_prologue((frompc));}
+#define SKIP_PROLOGUE(frompc) (i386_skip_prologue (frompc))
extern int i386_skip_prologue PARAMS ((int));
/* Stack grows downward. */
-#define INNER_THAN <
+#define INNER_THAN(lhs,rhs) ((lhs) < (rhs))
/* Sequence of bytes for breakpoint instruction. */
#define DECR_PC_AFTER_BREAK 1
-/* Nonzero if instruction at PC is a return instruction. */
-
-#define ABOUT_TO_RETURN(pc) (read_memory_integer ((pc), 1) == 0xc3)
-
/* Say how long (ordinary) registers are. This is a piece of bogosity
used in push_word and a few other places; REGISTER_RAW_SIZE is the
real way to know how big a register is. */
#define FPC_REGNUM 25 /* 80387 control register */
/* Total amount of space needed to store our copies of the machine's register
- state, the array `registers'. Default is 16 i*86 registers and 8 floating
- point registers. */
+ state, the array `registers'. */
-#define REGISTER_BYTES (16*4 + 8*10)
+#define REGISTER_BYTES ((NUM_REGS - NUM_FREGS)*4 + NUM_FREGS*10)
/* Index within `registers' of the first byte of the space for register N. */
subroutine will return. This is called from call_function. */
#define STORE_STRUCT_RETURN(ADDR, SP) \
- { (SP) -= sizeof (ADDR); \
- write_memory ((SP), (char *) &(ADDR), sizeof (ADDR)); }
+ { char buf[REGISTER_SIZE]; \
+ (SP) -= sizeof (ADDR); \
+ store_address (buf, sizeof (ADDR), ADDR); \
+ write_memory ((SP), buf, sizeof (ADDR)); }
/* Extract from an array REGBUF containing the (raw) register state
a function return value of type TYPE, and copy that, in virtual format,