From 60054393321258d1acc88f65169fb60589cb4b41 Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Wed, 10 May 2000 17:38:16 +0000 Subject: 2000-05-08 Michael Snyder * gdbarch.sh: Add FP0_REGNUM to list of multi-arched register numbers. * gdbarch.c, gdbarch.h: Regenerate. * core-regset.c: Change FP0_REGNUM to a runtime test. * procfs.c: Ditto. * sun3-nat.c: Ditto. * sparc-tdep.c: Ditto. * i386mach-nat.c: Remove unnecessary ifdef for FP0_REGNUM. * ptx4-nat.c: Ditto. * sol-thread.c (sol_thread_create_inferior): only add the thread to the thread list if it is not already in there. (prototypes for thread_db func ptrs): pretty up formatting. --- gdb/procfs.c | 69 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 35 insertions(+), 34 deletions(-) (limited to 'gdb/procfs.c') diff --git a/gdb/procfs.c b/gdb/procfs.c index 1a6c947..2fa825b 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -3502,19 +3502,20 @@ procfs_fetch_registers (regno) supply_gregset (gregs); -#if defined (FP0_REGNUM) /* need floating point? */ - if ((regno >= 0 && regno < FP0_REGNUM) || - regno == PC_REGNUM || - (NPC_REGNUM >= 0 && regno == NPC_REGNUM) || - regno == FP_REGNUM || - regno == SP_REGNUM) - return; /* not a floating point register */ + if (FP0_REGNUM >= 0) /* need floating point? */ + { + if ((regno >= 0 && regno < FP0_REGNUM) || + regno == PC_REGNUM || + (NPC_REGNUM >= 0 && regno == NPC_REGNUM) || + regno == FP_REGNUM || + regno == SP_REGNUM) + return; /* not a floating point register */ - if ((fpregs = proc_get_fpregs (pi)) == NULL) - proc_error (pi, "fetch_registers, get_fpregs", __LINE__); + if ((fpregs = proc_get_fpregs (pi)) == NULL) + proc_error (pi, "fetch_registers, get_fpregs", __LINE__); - supply_fpregset (fpregs); -#endif + supply_fpregset (fpregs); + } } /* Get ready to modify the registers array. On machines which store @@ -3576,21 +3577,22 @@ procfs_store_registers (regno) if (!proc_set_gregs (pi)) proc_error (pi, "store_registers, set_gregs", __LINE__); -#if defined (FP0_REGNUM) /* need floating point? */ - if ((regno >= 0 && regno < FP0_REGNUM) || - regno == PC_REGNUM || - (NPC_REGNUM >= 0 && regno == NPC_REGNUM) || - regno == FP_REGNUM || - regno == SP_REGNUM) - return; /* not a floating point register */ - - if ((fpregs = proc_get_fpregs (pi)) == NULL) - proc_error (pi, "store_registers, get_fpregs", __LINE__); - - fill_fpregset (fpregs, regno); - if (!proc_set_fpregs (pi)) - proc_error (pi, "store_registers, set_fpregs", __LINE__); -#endif + if (FP0_REGNUM >= 0) /* need floating point? */ + { + if ((regno >= 0 && regno < FP0_REGNUM) || + regno == PC_REGNUM || + (NPC_REGNUM >= 0 && regno == NPC_REGNUM) || + regno == FP_REGNUM || + regno == SP_REGNUM) + return; /* not a floating point register */ + + if ((fpregs = proc_get_fpregs (pi)) == NULL) + proc_error (pi, "store_registers, get_fpregs", __LINE__); + + fill_fpregset (fpregs, regno); + if (!proc_set_fpregs (pi)) + proc_error (pi, "store_registers, set_fpregs", __LINE__); + } } /* @@ -4111,14 +4113,13 @@ invalidate_cache (parent, pi, ptr) if (!proc_set_gregs (pi)) /* flush gregs cache */ proc_warn (pi, "target_resume, set_gregs", __LINE__); -#ifdef FP0_REGNUM - if (pi->fpregs_dirty) - if (parent == NULL || - proc_get_current_thread (parent) != pi->tid) - if (!proc_set_fpregs (pi)) /* flush fpregs cache */ - proc_warn (pi, "target_resume, set_fpregs", - __LINE__); -#endif + if (FP0_REGNUM >= 0) + if (pi->fpregs_dirty) + if (parent == NULL || + proc_get_current_thread (parent) != pi->tid) + if (!proc_set_fpregs (pi)) /* flush fpregs cache */ + proc_warn (pi, "target_resume, set_fpregs", + __LINE__); #endif if (parent != NULL) -- cgit v1.1