From bb4569b9f65a36902a8c82d6f27cebca98dbd46b Mon Sep 17 00:00:00 2001 From: Peter Schauer Date: Sat, 21 Dec 1996 10:10:43 +0000 Subject: [PATCH] * irix5-nat.c (fill_gregset): Sign extend registers before filling in the gregset structure. --- gdb/ChangeLog | 5 +++++ gdb/irix5-nat.c | 24 ++++++++++++++---------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a5682049362..772c44c6c1e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +Sat Dec 21 02:08:14 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * irix5-nat.c (fill_gregset): Sign extend registers before + filling in the gregset structure. + Fri Dec 20 11:06:03 1996 Stu Grossman (grossman@critters.cygnus.com) * mswin/genmakes: Don't define _DEBUG. This breaks wingdb. diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c index 60ab6894d35..4ba686a8a17 100644 --- a/gdb/irix5-nat.c +++ b/gdb/irix5-nat.c @@ -75,31 +75,35 @@ fill_gregset (gregsetp, regno) int regi; register greg_t *regp = &(*gregsetp)[0]; + /* Under Irix6, if GDB is built with N32 ABI and is debugging an O32 + executable, we have to sign extend the registers to 64 bits before + filling in the gregset structure. */ + for (regi = 0; regi <= CTX_RA; regi++) if ((regno == -1) || (regno == regi)) *(regp + regi) = - extract_address (®isters[REGISTER_BYTE (regi)], - REGISTER_RAW_SIZE (regi)); + extract_signed_integer (®isters[REGISTER_BYTE (regi)], + REGISTER_RAW_SIZE (regi)); if ((regno == -1) || (regno == PC_REGNUM)) *(regp + CTX_EPC) = - extract_address (®isters[REGISTER_BYTE (PC_REGNUM)], - REGISTER_RAW_SIZE (PC_REGNUM)); + extract_signed_integer (®isters[REGISTER_BYTE (PC_REGNUM)], + REGISTER_RAW_SIZE (PC_REGNUM)); if ((regno == -1) || (regno == CAUSE_REGNUM)) *(regp + CTX_CAUSE) = - extract_address (®isters[REGISTER_BYTE (CAUSE_REGNUM)], - REGISTER_RAW_SIZE (CAUSE_REGNUM)); + extract_signed_integer (®isters[REGISTER_BYTE (CAUSE_REGNUM)], + REGISTER_RAW_SIZE (CAUSE_REGNUM)); if ((regno == -1) || (regno == HI_REGNUM)) *(regp + CTX_MDHI) = - extract_address (®isters[REGISTER_BYTE (HI_REGNUM)], - REGISTER_RAW_SIZE (HI_REGNUM)); + extract_signed_integer (®isters[REGISTER_BYTE (HI_REGNUM)], + REGISTER_RAW_SIZE (HI_REGNUM)); if ((regno == -1) || (regno == LO_REGNUM)) *(regp + CTX_MDLO) = - extract_address (®isters[REGISTER_BYTE (LO_REGNUM)], - REGISTER_RAW_SIZE (LO_REGNUM)); + extract_signed_integer (®isters[REGISTER_BYTE (LO_REGNUM)], + REGISTER_RAW_SIZE (LO_REGNUM)); } /* -- 2.30.2