Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] Fix recent compilation errors in alpha-nat.c on alpha-osf
@ 2002-04-22  6:42 Joel Brobecker
  2002-04-22  8:49 ` Jason R Thorpe
  2002-04-22  8:56 ` Jason R Thorpe
  0 siblings, 2 replies; 8+ messages in thread
From: Joel Brobecker @ 2002-04-22  6:42 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 544 bytes --]

I tested the following change on Tru64 5.1. I made the small change
possible to allow this code to compile again, there is probably a better
way to write this code, but I'm not very familiar with this part of the
code...

Ideas for a better fix are welcome.

2002-04-22  J. Brobecker  <brobecker@gnat.com>
        * alpha-nat.c (fetch_osf_core_registers): Fix compilation errors
        due to NUM_REGS and MAX_REGISTER_RAW_SIZE not being constants
        anymore after a recent multi-arching effort.
        (supply_gregset): Ditto

-- 
Joel

[-- Attachment #2: alpha-nat.c.diff --]
[-- Type: text/plain, Size: 2133 bytes --]

Index: alpha-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/alpha-nat.c,v
retrieving revision 1.9
diff -c -3 -p -r1.9 alpha-nat.c
*** alpha-nat.c	21 Apr 2002 16:52:39 -0000	1.9
--- alpha-nat.c	22 Apr 2002 13:32:32 -0000
*************** fetch_osf_core_registers (char *core_reg
*** 101,107 ****
       OSF/1.2 core files.  OSF5 uses different names for the register
       enum list, need to handle two cases.  The actual values are the
       same.  */
!   static int core_reg_mapping[NUM_REGS] =
    {
  #ifdef NCF_REGS
  #define EFL NCF_REGS
--- 101,107 ----
       OSF/1.2 core files.  OSF5 uses different names for the register
       enum list, need to handle two cases.  The actual values are the
       same.  */
!   static int core_reg_mapping[] =
    {
  #ifdef NCF_REGS
  #define EFL NCF_REGS
*************** fetch_osf_core_registers (char *core_reg
*** 127,134 ****
      EF_PC, -1
  #endif
    };
!   static char zerobuf[MAX_REGISTER_RAW_SIZE] =
!   {0};
  
    for (regno = 0; regno < NUM_REGS; regno++)
      {
--- 127,139 ----
      EF_PC, -1
  #endif
    };
!   char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE * sizeof (char));
! 
!   if (sizeof (core_reg_mapping) != NUM_REGS)
!     internal_error (__FILE__, __LINE__,
!                     "Invalid number of elements in register mapping array.");
! 
!   memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE * sizeof (char));
  
    for (regno = 0; regno < NUM_REGS; regno++)
      {
*************** supply_gregset (gdb_gregset_t *gregsetp)
*** 222,229 ****
  {
    register int regi;
    register long *regp = ALPHA_REGSET_BASE (gregsetp);
!   static char zerobuf[MAX_REGISTER_RAW_SIZE] =
!   {0};
  
    for (regi = 0; regi < 31; regi++)
      supply_register (regi, (char *) (regp + regi));
--- 227,235 ----
  {
    register int regi;
    register long *regp = ALPHA_REGSET_BASE (gregsetp);
!   char *zerobuf = alloca (MAX_REGISTER_RAW_SIZE * sizeof (char));
! 
!   memset (zerobuf, 0, MAX_REGISTER_RAW_SIZE * sizeof (char));
  
    for (regi = 0; regi < 31; regi++)
      supply_register (regi, (char *) (regp + regi));

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-04-24  5:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-22  6:42 [RFA] Fix recent compilation errors in alpha-nat.c on alpha-osf Joel Brobecker
2002-04-22  8:49 ` Jason R Thorpe
2002-04-22  8:56 ` Jason R Thorpe
2002-04-23  3:14   ` Joel Brobecker
2002-04-23  3:55     ` David S. Miller
2002-04-23 10:56       ` Michael Snyder
2002-04-23 16:33       ` Andrew Cagney
2002-04-23 22:04         ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox