This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
[PATCH]: Solaris core files.
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: [PATCH]: Solaris core files.
- From: msnyder at cygnus dot com
- Date: Wed, 24 May 2000 17:18:15 -0700 (PDT)
Two small changes:
1) Explicitly include sys/privregs.h on Solaris Sparc64, and
2) Get rid of a couple of #defines by using a cast instead. Nicer.
2000-05-24 Michael Snyder <msnyder@seadog.cygnus.com>
* core-sol2.c (fetch_core_registers): Do type punning by casting,
rather than by using a define. Also an explicit include is
needed on Sparc64 Solaris.
Index: core-sol2.c
===================================================================
RCS file: /cvs/src/src/gdb/core-sol2.c,v
retrieving revision 1.1.1.3
diff -c -r1.1.1.3 core-sol2.c
*** core-sol2.c 1999/10/05 23:08:07 1.1.1.3
--- core-sol2.c 2000/05/25 00:13:21
***************
*** 27,32 ****
--- 27,38 ----
and sparc-nat.c to be able to read both flavours. */
#include "defs.h"
+
+ #if defined (__sparcv9)
+ /* Fails to get included by the system header files. */
+ # include <v9/sys/privregs.h>
+ #endif
+
#include <time.h>
#include <sys/types.h>
#include <sys/regset.h>
***************
*** 40,45 ****
--- 46,54 ----
#include "command.h"
#include "gdbcore.h"
+ /* Prototypes for supply_gregset etc. */
+ #include "gregset.h"
+
static void fetch_core_registers PARAMS ((char *, unsigned, int, CORE_ADDR));
static void
***************
*** 61,67 ****
}
else if (core_reg_size == sizeof (struct regs))
{
! #define gregs ((struct regs *)core_reg_sect)
/* G0 *always* holds 0. */
*(int *) ®isters[REGISTER_BYTE (0)] = 0;
--- 70,77 ----
}
else if (core_reg_size == sizeof (struct regs))
{
! struct regs *gregs = (struct regs *)core_reg_sect;
!
/* G0 *always* holds 0. */
*(int *) ®isters[REGISTER_BYTE (0)] = 0;
***************
*** 104,110 ****
}
else if (core_reg_size >= sizeof (struct fpu))
{
! #define fpuregs ((struct fpu *) core_reg_sect)
memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], &fpuregs->fpu_fr,
sizeof (fpuregs->fpu_fr));
memcpy (®isters[REGISTER_BYTE (FPS_REGNUM)], &fpuregs->fpu_fsr,
--- 114,121 ----
}
else if (core_reg_size >= sizeof (struct fpu))
{
! struct fpu *fpuregs = (struct fpu *) core_reg_sect;
!
memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], &fpuregs->fpu_fr,
sizeof (fpuregs->fpu_fr));
memcpy (®isters[REGISTER_BYTE (FPS_REGNUM)], &fpuregs->fpu_fsr,