From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1737 invoked by alias); 1 Dec 2005 13:43:03 -0000 Received: (qmail 1728 invoked by uid 22791); 1 Dec 2005 13:43:03 -0000 X-Spam-Check-By: sourceware.org Received: from dumbledore.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.11) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 01 Dec 2005 13:42:57 +0000 Received: (qmail 7056 invoked from network); 1 Dec 2005 13:42:55 -0000 Received: from unknown (HELO ?192.168.189.167?) (nathan@127.0.0.2) by mail.codesourcery.com with ESMTPA; 1 Dec 2005 13:42:55 -0000 Message-ID: <438EFDF3.2050106@codesourcery.com> Date: Thu, 01 Dec 2005 13:43:00 -0000 From: Nathan Sidwell User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013) MIME-Version: 1.0 CC: gdb-patches@sources.redhat.com, msnyder@redhat.com Subject: Re: [patch] Fix ms1 warnings References: <438EF905.9020502@codesourcery.com> In-Reply-To: <438EF905.9020502@codesourcery.com> Content-Type: multipart/mixed; boundary="------------020506080907030904020600" Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2005-12/txt/msg00010.txt.bz2 This is a multi-part message in MIME format. --------------020506080907030904020600 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 336 Nathan Sidwell wrote: > I've installed this obvious patch to silence some warnings and remove a > compilation error. > > tested on ms1-elf oops, forgot to attach the patch, -- Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk --------------020506080907030904020600 Content-Type: text/plain; name="ms1-clean.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ms1-clean.diff" Content-length: 5146 2005-12-01 Nathan Sidwell * ms1-tdep.c (ms1_register_name): Const qualify array. (ms1_registers_info): Use gdb_byte. (ms1_push_dummy_call): Likewise. (ms1_gdbarch_init): Remove illformed nested prototype. Index: ms1-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/ms1-tdep.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -3 -p -r1.1 -r1.2 *** ms1-tdep.c 15 Aug 2005 21:46:38 -0000 1.1 --- ms1-tdep.c 1 Dec 2005 13:19:58 -0000 1.2 *************** enum ms1_gdb_regnums *** 126,132 **** static const char * ms1_register_name (int regnum) { ! static char *register_names[] = { /* CPU regs. */ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", --- 126,132 ---- static const char * ms1_register_name (int regnum) { ! static const char *const register_names[] = { /* CPU regs. */ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", *************** ms1_registers_info (struct gdbarch *gdba *** 530,536 **** || regnum == MS1_COPRO_PSEUDOREG_REGNUM) { /* Special output handling for the 'coprocessor' register. */ ! char *buf; buf = alloca (register_size (gdbarch, MS1_COPRO_REGNUM)); frame_register_read (frame, MS1_COPRO_REGNUM, buf); --- 530,536 ---- || regnum == MS1_COPRO_PSEUDOREG_REGNUM) { /* Special output handling for the 'coprocessor' register. */ ! gdb_byte *buf; buf = alloca (register_size (gdbarch, MS1_COPRO_REGNUM)); frame_register_read (frame, MS1_COPRO_REGNUM, buf); *************** ms1_registers_info (struct gdbarch *gdba *** 545,558 **** else if (regnum == MS1_MAC_REGNUM || regnum == MS1_MAC_PSEUDOREG_REGNUM) { ULONGEST oldmac, ext_mac, newmac; ! char buf[3 * sizeof (LONGEST)]; /* Get the two "real" mac registers. */ frame_register_read (frame, MS1_MAC_REGNUM, buf); oldmac = extract_unsigned_integer (buf, register_size (gdbarch, MS1_MAC_REGNUM)); ! if (gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_mrisc2) { frame_register_read (frame, MS1_EXMAC_REGNUM, buf); ext_mac = extract_unsigned_integer (buf, --- 545,559 ---- else if (regnum == MS1_MAC_REGNUM || regnum == MS1_MAC_PSEUDOREG_REGNUM) { ULONGEST oldmac, ext_mac, newmac; ! gdb_byte buf[3 * sizeof (LONGEST)]; /* Get the two "real" mac registers. */ frame_register_read (frame, MS1_MAC_REGNUM, buf); oldmac = extract_unsigned_integer (buf, register_size (gdbarch, MS1_MAC_REGNUM)); ! if (gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_mrisc2 ! || gdbarch_bfd_arch_info (gdbarch)->mach == bfd_mach_ms2) { frame_register_read (frame, MS1_EXMAC_REGNUM, buf); ext_mac = extract_unsigned_integer (buf, *************** ms1_push_dummy_call (struct gdbarch *gdb *** 594,600 **** int struct_return, CORE_ADDR struct_addr) { #define wordsize 4 ! char buf[MS1_MAX_STRUCT_SIZE]; int argreg = MS1_1ST_ARGREG; int split_param_len = 0; int stack_dest = sp; --- 595,601 ---- int struct_return, CORE_ADDR struct_addr) { #define wordsize 4 ! gdb_byte buf[MS1_MAX_STRUCT_SIZE]; int argreg = MS1_1ST_ARGREG; int split_param_len = 0; int stack_dest = sp; *************** ms1_push_dummy_call (struct gdbarch *gdb *** 606,612 **** MS1_LAST_ARGREG. */ for (i = 0; i < nargs && argreg <= MS1_LAST_ARGREG; i++) { ! const char *val; typelen = TYPE_LENGTH (value_type (args[i])); switch (typelen) { --- 607,613 ---- MS1_LAST_ARGREG. */ for (i = 0; i < nargs && argreg <= MS1_LAST_ARGREG; i++) { ! const gdb_byte *val; typelen = TYPE_LENGTH (value_type (args[i])); switch (typelen) { *************** ms1_push_dummy_call (struct gdbarch *gdb *** 658,664 **** /* Next, the rest of the arguments go onto the stack, in reverse order. */ for (j = nargs - 1; j >= i; j--) { ! char *val; /* Right-justify the value in an aligned-length buffer. */ typelen = TYPE_LENGTH (value_type (args[j])); slacklen = (wordsize - (typelen % wordsize)) % wordsize; --- 659,666 ---- /* Next, the rest of the arguments go onto the stack, in reverse order. */ for (j = nargs - 1; j >= i; j--) { ! gdb_byte *val; ! /* Right-justify the value in an aligned-length buffer. */ typelen = TYPE_LENGTH (value_type (args[j])); slacklen = (wordsize - (typelen % wordsize)) % wordsize; *************** static struct gdbarch * *** 961,967 **** ms1_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) { struct gdbarch *gdbarch; - static void ms1_frame_unwind_init (struct gdbarch *); /* Find a candidate among the list of pre-declared architectures. */ arches = gdbarch_list_lookup_by_info (arches, &info); --- 963,968 ---- --------------020506080907030904020600--