From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12214 invoked by alias); 22 Apr 2002 13:42:46 -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 12173 invoked from network); 22 Apr 2002 13:42:37 -0000 Received: from unknown (HELO dublin.ACT-Europe.FR) (212.157.227.154) by sources.redhat.com with SMTP; 22 Apr 2002 13:42:37 -0000 Received: from berlin.ACT-Europe.FR (berlin.int.act-europe.fr [10.10.0.169]) by dublin.ACT-Europe.FR (Postfix) with ESMTP id 0DE23229EF3 for ; Mon, 22 Apr 2002 15:42:35 +0200 (MET DST) Received: by berlin.ACT-Europe.FR (Postfix, from userid 507) id B761995B; Mon, 22 Apr 2002 15:42:34 +0200 (CEST) Date: Mon, 22 Apr 2002 06:42:00 -0000 From: Joel Brobecker To: gdb-patches@sources.redhat.com Subject: [RFA] Fix recent compilation errors in alpha-nat.c on alpha-osf Message-ID: <20020422154234.F21070@act-europe.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="JgQwtEuHJzHdouWu" Content-Disposition: inline User-Agent: Mutt/1.2.5i X-SW-Source: 2002-04/txt/msg00790.txt.bz2 --JgQwtEuHJzHdouWu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 544 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 * 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 --JgQwtEuHJzHdouWu Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="alpha-nat.c.diff" Content-length: 2133 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)); --JgQwtEuHJzHdouWu--