From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9621 invoked by alias); 7 Nov 2004 17:09:43 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 9604 invoked from network); 7 Nov 2004 17:09:41 -0000 Received: from unknown (HELO walton.sibelius.xs4all.nl) (82.92.89.47) by sourceware.org with SMTP; 7 Nov 2004 17:09:41 -0000 Received: from elgar.sibelius.xs4all.nl (elgar.sibelius.xs4all.nl [192.168.0.2]) by walton.sibelius.xs4all.nl (8.13.0/8.13.0) with ESMTP id iA7H9fnM029417 for ; Sun, 7 Nov 2004 18:09:41 +0100 (CET) Received: from elgar.sibelius.xs4all.nl (localhost [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.12.6p3/8.12.6) with ESMTP id iA7H9eet032427 for ; Sun, 7 Nov 2004 18:09:40 +0100 (CET) (envelope-from kettenis@elgar.sibelius.xs4all.nl) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.12.6p3/8.12.6/Submit) id iA7H9ex4032424; Sun, 7 Nov 2004 18:09:40 +0100 (CET) Date: Sun, 07 Nov 2004 17:09:00 -0000 Message-Id: <200411071709.iA7H9ex4032424@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: gdb-patches@sources.redhat.com Subject: [COMMIT] Properly handle floating-point registers on OpenBSD/mips64 X-SW-Source: 2004-11/txt/msg00113.txt.bz2 This makes sure they end up at the right spot in the register cache. Committed, Mark Index: ChangeLog from Mark Kettenis * mips64obsd-nat.c: Include "mips-tdep.h". (MIPS64OBSD_NUM_REGS): Remove define. (MIPS_PC_REGNUM, MIPS_FP0_REGNUM, MIPS_FSR_REGNUM): New defines. (mips64obsd_supply_gregset, mips64obsd_collect_gregset): Handle floating-point registers correctly. * Makefile.in (mips64obsd-nat.o): Update dependencies. Index: Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/Makefile.in,v retrieving revision 1.656 diff -u -p -r1.656 Makefile.in --- Makefile.in 7 Nov 2004 17:02:43 -0000 1.656 +++ Makefile.in 7 Nov 2004 17:06:15 -0000 @@ -2236,7 +2236,7 @@ mem-break.o: mem-break.c $(defs_h) $(sym minsyms.o: minsyms.c $(defs_h) $(gdb_string_h) $(symtab_h) $(bfd_h) \ $(symfile_h) $(objfiles_h) $(demangle_h) $(value_h) $(cp_abi_h) mips64obsd-nat.o: mips64obsd-nat.c $(defs_h) $(inferior_h) $(regcache_h) \ - $(target_h) $(inf_ptrace_h) + $(target_h) $(mips_tdep_h) $(inf_ptrace_h) mips64obsd-tdep.o: mips64obsd-tdep.c $(defs_h) $(osabi_h) $(regcache_h) \ $(regset_h) $(trad_frame_h) $(tramp_frame_h) $gdb_assert_h) \ $(gdb_string_h) $(mips_tdep_h) $(solib_svr4_h) Index: mips64obsd-nat.c =================================================================== RCS file: /cvs/src/src/gdb/mips64obsd-nat.c,v retrieving revision 1.1 diff -u -p -r1.1 mips64obsd-nat.c --- mips64obsd-nat.c 23 Oct 2004 12:14:01 -0000 1.1 +++ mips64obsd-nat.c 7 Nov 2004 17:06:15 -0000 @@ -28,9 +28,13 @@ #include #include +#include "mips-tdep.h" #include "inf-ptrace.h" -#define MIPS64OBSD_NUM_REGS 73 +/* Shorthand for some register numbers used below. */ +#define MIPS_PC_REGNUM MIPS_EMBED_PC_REGNUM +#define MIPS_FP0_REGNUM MIPS_EMBED_FP0_REGNUM +#define MIPS_FSR_REGNUM MIPS_EMBED_FP0_REGNUM + 32 /* Supply the general-purpose registers stored in GREGS to REGCACHE. */ @@ -40,8 +44,11 @@ mips64obsd_supply_gregset (struct regcac const char *regs = gregs; int regnum; - for (regnum = 0; regnum < MIPS64OBSD_NUM_REGS; regnum++) + for (regnum = MIPS_ZERO_REGNUM; regnum <= MIPS_PC_REGNUM; regnum++) regcache_raw_supply (regcache, regnum, regs + regnum * 8); + + for (regnum = MIPS_FP0_REGNUM; regnum <= MIPS_FSR_REGNUM; regnum++) + regcache_raw_supply (regcache, regnum, regs + (regnum + 2) * 8); } /* Collect the general-purpose registers from REGCACHE and store them @@ -54,11 +61,17 @@ mips64obsd_collect_gregset (const struct char *regs = gregs; int i; - for (i = 0; i <= MIPS64OBSD_NUM_REGS; i++) + for (i = MIPS_ZERO_REGNUM; i <= MIPS_PC_REGNUM; i++) { if (regnum == -1 || regnum == i) regcache_raw_collect (regcache, i, regs + i * 8); } + + for (i = MIPS_FP0_REGNUM; i <= MIPS_FSR_REGNUM; i++) + { + if (regnum == -1 || regnum == i) + regcache_raw_collect (regcache, i, regs + (i + 2) * 8); + } }