From b051bfa4994eb91113ad1961bbf46507930d510e Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Wed, 31 May 2000 23:14:19 +0000 Subject: [PATCH] * i386bsd-nat.c: Include "gregset.h". (CANNOT_STORE_REGISTER): Define to cannot_fetch_register instead of CANNOT_FETCH_REGISTER, if not already defined. (supply_gregset): Call supply_register with NULL as its second argument instead of supplying our own zeroed out buffer. (fill_gregset): Copy contents of correct registers instead of the contents of register REGNO. --- gdb/ChangeLog | 10 ++++++++++ gdb/i386bsd-nat.c | 15 +++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a02a39ca68c..34247f7dcbe 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,13 @@ +2000-06-01 Mark Kettenis + + * i386bsd-nat.c: Include "gregset.h". + (CANNOT_STORE_REGISTER): Define to cannot_fetch_register instead + of CANNOT_FETCH_REGISTER, if not already defined. + (supply_gregset): Call supply_register with NULL as its second + argument instead of supplying our own zeroed out buffer. + (fill_gregset): Copy contents of correct registers instead of the + contents of register REGNO. + 2000-05-31 Kevin Buettner * gnu-regex.c (re_match_2_internal): Revert 2000-05-27 diff --git a/gdb/i386bsd-nat.c b/gdb/i386bsd-nat.c index c4def7e568f..aadf5864c92 100644 --- a/gdb/i386bsd-nat.c +++ b/gdb/i386bsd-nat.c @@ -38,6 +38,9 @@ typedef struct reg gregset_t; typedef struct fpreg fpregset_t; #endif +#include "gregset.h" + + /* In older BSD versions we cannot get at some of the segment registers. FreeBSD for example didn't support the %fs and %gs registers until the 3.0 release. We have autoconf checks for their @@ -50,7 +53,7 @@ typedef struct fpreg fpregset_t; /* Registers we shouldn't try to store. */ #if !defined (CANNOT_STORE_REGISTER) -#define CANNOT_STORE_REGISTER(regno) CANNOT_FETCH_REGISTER (regno) +#define CANNOT_STORE_REGISTER(regno) cannot_fetch_register (regno) #endif /* Offset to the gregset_t location where REG is stored. */ @@ -106,16 +109,12 @@ cannot_fetch_register (int regno) void supply_gregset (gregset_t *gregsetp) { - char buf[MAX_REGISTER_RAW_SIZE]; int i; for (i = 0; i < NUM_GREGS; i++) { if (CANNOT_FETCH_REGISTER (i)) - { - memset (buf, 0, REGISTER_RAW_SIZE (i)); - supply_register (i, buf); - } + supply_register (i, NULL); else supply_register (i, REG_ADDR (gregsetp, i)); } @@ -132,7 +131,7 @@ fill_gregset (gregset_t *gregsetp, int regno) for (i = 0; i < NUM_GREGS; i++) if ((regno == -1 || regno == i) && ! CANNOT_STORE_REGISTER (i)) - memcpy (REG_ADDR (gregsetp, i), ®isters[REGISTER_BYTE (regno)], + memcpy (REG_ADDR (gregsetp, i), ®isters[REGISTER_BYTE (i)], REGISTER_RAW_SIZE (i)); } @@ -180,7 +179,7 @@ fetch_inferior_registers (int regno) supply_fpregset (&fpregs); } -} +} /* Store register REGNO back into the inferior. If REGNO is -1, do this for all registers (including the floating point registers). */ -- 2.30.2