From e33aefba5a547a6f61c436b47ff3a73ee275e886 Mon Sep 17 00:00:00 2001 From: Fred Fish Date: Thu, 4 Jan 1996 07:23:24 +0000 Subject: [PATCH] * i386v4-nat.c (supply_gregset, fill_gregset): Subtract NUM_FREGS from NUM_REGS to get number of general registers that we care about. Update copyright to 1996. * config/i386/tm-i386.h (REGISTER_BYTES): Define in terms of number of general regs and number of floating point regs. Update copyright to 1996. --- gdb/ChangeLog | 9 +++++++++ gdb/config/i386/tm-i386.h | 7 +++---- gdb/i386v4-nat.c | 12 +++++++++--- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9c2aface23..bb861784f1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +Wed Jan 3 23:13:53 1996 Fred Fish + + * i386v4-nat.c (supply_gregset, fill_gregset): Subtract NUM_FREGS + from NUM_REGS to get number of general registers that we care about. + Update copyright to 1996. + * config/i386/tm-i386.h (REGISTER_BYTES): Define in terms + of number of general regs and number of floating point regs. + Update copyright to 1996. + Wed Jan 3 19:49:54 1996 steve chamberlain * config/i386/tm-win32.h (IN_SOLIB_CALL_TRAMPOLINE): New. diff --git a/gdb/config/i386/tm-i386.h b/gdb/config/i386/tm-i386.h index 819735cea5..8f8090b96f 100644 --- a/gdb/config/i386/tm-i386.h +++ b/gdb/config/i386/tm-i386.h @@ -1,5 +1,5 @@ /* 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. @@ -115,10 +115,9 @@ extern int i386_skip_prologue PARAMS ((int)); #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. */ diff --git a/gdb/i386v4-nat.c b/gdb/i386v4-nat.c index 2de84073a8..1f1d38b7ea 100644 --- a/gdb/i386v4-nat.c +++ b/gdb/i386v4-nat.c @@ -1,5 +1,5 @@ /* Native-dependent code for SVR4 Unix running on i386's, for GDB. - Copyright 1988, 1989, 1991, 1992 Free Software Foundation, Inc. + Copyright 1988, 1989, 1991, 1992, 1996 Free Software Foundation, Inc. This file is part of GDB. @@ -75,6 +75,12 @@ static int regmap[] = }; +/* FIXME: These routine absolutely depends upon (NUM_REGS - NUM_FREGS) + being less than or equal to the number of registers that can be stored + in a gregset_t. Note that with the current scheme there will typically + be more registers actually stored in a gregset_t that what we know + about. This is bogus and should be fixed. */ + /* Given a pointer to a general register set in /proc format (gregset_t *), unpack the register contents and supply them as gdb's idea of the current register values. */ @@ -87,7 +93,7 @@ supply_gregset (gregsetp) register greg_t *regp = (greg_t *) gregsetp; extern int regmap[]; - for (regi = 0 ; regi < NUM_REGS ; regi++) + for (regi = 0 ; regi < (NUM_REGS - NUM_FREGS) ; regi++) { supply_register (regi, (char *) (regp + regmap[regi])); } @@ -103,7 +109,7 @@ fill_gregset (gregsetp, regno) extern char registers[]; extern int regmap[]; - for (regi = 0 ; regi < NUM_REGS ; regi++) + for (regi = 0 ; regi < (NUM_REGS - NUM_FREGS) ; regi++) { if ((regno == -1) || (regno == regi)) {