From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21173 invoked by alias); 1 Apr 2010 14:57:40 -0000 Received: (qmail 21137 invoked by uid 22791); 1 Apr 2010 14:57:37 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=BAYES_00,MSGID_MULTIPLE_AT,TW_CP,TW_OC,TW_XS X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.151) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 01 Apr 2010 14:57:31 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o31EvRQu084382 for ; Thu, 1 Apr 2010 16:57:27 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms1.u-strasbg.fr [IPv6:2001:660:2402:d::10]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id o31EvP7k085287 for ; Thu, 1 Apr 2010 16:57:25 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from d620muller (gw-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o31EvPHs046654 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Thu, 1 Apr 2010 16:57:25 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: Subject: [RFA] ARI fix: remove remaining %ll occurences. Date: Thu, 01 Apr 2010 14:57:00 -0000 Message-ID: <002401cad1ab$a8163180$f8429480$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-04/txt/msg00018.txt.bz2 I tried to removed remaining "%ll" occurrences in gdb source, but discovered that %ll was used at several places inside scanf functions. As there is no way LONGEST can be specified for scanf, I took the option to allow %ll inside scanf calls. Apart from these, the other %ll where easy to remove, but I still would like an approval by a global maintainer as I am unable to compile part of these changes (nat files for targets I have no access to). The change is quite mechanical, replace: "0x%llx" by "%s" using hex_string call, "%016llx" by "%s" using phex call and "%lld" by "%s" using plongest call. I checked the patch with a testsuite run of the compilation farm, which uses --enable-targets=all configratuion option, and no significant change is visible. Is this OK? Pierre Muller as ARI maintainer. This the the change for gdb_ari.sh, it just allows %ll inside scanf calls: Index: ss/gdb_ari.sh =================================================================== RCS file: /cvs/gdbadmin/ss/gdb_ari.sh,v retrieving revision 1.100 diff -u -p -r1.100 gdb_ari.sh --- src/gdb/gdb_ari.sh 31 Mar 2010 13:34:48 -0000 1.100 +++ src/gdb/gdb_ari.sh 1 Apr 2010 14:06:29 -0000 @@ -378,7 +378,8 @@ Do not use printf(\"%ll\"), instead use `long long'\'' value" category["%ll"] = ari_code } -/%ll/ { +# Allow %ll in scanf +/%ll/ && !/scanf \(.*%ll/ { fail("%ll") } 2010-04-01 Pierre Muller Remove remaining "%ll" uses. * go32-nat.c (go32_pte_for_address): Replace "0x%llx" using hex_string call. * rs6000-nat.c (rs6000_ptrace64): Idem. * solib-pa64.c (pa64_current_sos): Idem. * solib-spu.c (spu_current_sos): Idem. * linux-nat.c (linux_nat_find_memory_regions): Replace "%lld" using plongest call. * nto-procfs.c (procfs_meminfo): Replace "0x%016llx" using phex (VAR, 8) call. * sh64-tdep.c (sh64_show_media_regs): Idem. Index: src/gdb/go32-nat.c =================================================================== RCS file: /cvs/src/src/gdb/go32-nat.c,v retrieving revision 1.80 diff -u -p -r1.80 go32-nat.c --- src/gdb/go32-nat.c 1 Jan 2010 07:31:32 -0000 1.80 +++ src/gdb/go32-nat.c 1 Apr 2010 14:06:41 -0000 @@ -2047,8 +2047,8 @@ go32_pte_for_address (char *arg, int fro int pte_idx = (addr >> 12) & 0x3ff; unsigned offs = addr & 0xfff; - printf_filtered ("Page Table entry for address 0x%llx:\n", - (unsigned long long)addr); + printf_filtered ("Page Table entry for address %s:\n", + hex_string(addr)); display_ptable_entry (get_pte (get_pde (pde_idx), pte_idx), 0, 1, offs); } } Index: src/gdb/linux-nat.c =================================================================== RCS file: /cvs/src/src/gdb/linux-nat.c,v retrieving revision 1.165 diff -u -p -r1.165 linux-nat.c --- src/gdb/linux-nat.c 17 Mar 2010 16:17:00 -0000 1.165 +++ src/gdb/linux-nat.c 1 Apr 2010 14:06:42 -0000 @@ -4086,8 +4086,8 @@ linux_nat_find_memory_regions (int (*fun if (info_verbose) { fprintf_filtered (gdb_stdout, - "Save segment, %lld bytes at %s (%c%c%c)", - size, paddress (target_gdbarch, addr), + "Save segment, %s bytes at %s (%c%c%c)", + plongest (size), paddress (target_gdbarch, addr), read ? 'r' : ' ', write ? 'w' : ' ', exec ? 'x' : ' '); if (filename[0]) Index: src/gdb/rs6000-nat.c =================================================================== RCS file: /cvs/src/src/gdb/rs6000-nat.c,v retrieving revision 1.100 diff -u -p -r1.100 rs6000-nat.c --- src/gdb/rs6000-nat.c 1 Jan 2010 07:31:41 -0000 1.100 +++ src/gdb/rs6000-nat.c 1 Apr 2010 14:06:42 -0000 @@ -200,8 +200,8 @@ rs6000_ptrace64 (int req, int id, long l int ret = 0; #endif #if 0 - printf ("rs6000_ptrace64 (%d, %d, 0x%llx, %08x, 0x%x) = 0x%x\n", - req, id, addr, data, (unsigned int)buf, ret); + printf ("rs6000_ptrace64 (%d, %d, %s, %08x, 0x%x) = 0x%x\n", + req, id, hex_string (addr), data, (unsigned int)buf, ret); #endif return ret; } Index: src/gdb/solib-pa64.c =================================================================== RCS file: /cvs/src/src/gdb/solib-pa64.c,v retrieving revision 1.23 diff -u -p -r1.23 solib-pa64.c --- src/gdb/solib-pa64.c 24 Feb 2010 00:29:02 -0000 1.23 +++ src/gdb/solib-pa64.c 1 Apr 2010 14:06:43 -0000 @@ -493,17 +493,17 @@ pa64_current_sos (void) struct load_module_desc *d = &new->lm_info->desc; printf ("\n+ library \"%s\" is described at index %d\n", new->so_name, dll_index); - printf (" text_base = 0x%llx\n", d->text_base); - printf (" text_size = 0x%llx\n", d->text_size); - printf (" data_base = 0x%llx\n", d->data_base); - printf (" data_size = 0x%llx\n", d->data_size); - printf (" unwind_base = 0x%llx\n", d->unwind_base); - printf (" linkage_ptr = 0x%llx\n", d->linkage_ptr); - printf (" phdr_base = 0x%llx\n", d->phdr_base); - printf (" tls_size = 0x%llx\n", d->tls_size); - printf (" tls_start_addr = 0x%llx\n", d->tls_start_addr); - printf (" unwind_size = 0x%llx\n", d->unwind_size); - printf (" tls_index = 0x%llx\n", d->tls_index); + printf (" text_base = %s\n", hex_string (d->text_base)); + printf (" text_size = %s\n", hex_string (d->text_size)); + printf (" data_base = %s\n", hex_string (d->data_base)); + printf (" data_size = %s\n", hex_string (d->data_size)); + printf (" unwind_base = %s\n", hex_string (d->unwind_base)); + printf (" linkage_ptr = %s\n", hex_string (d->linkage_ptr)); + printf (" phdr_base = %s\n", hex_string (d->phdr_base)); + printf (" tls_size = %s\n", hex_string (d->tls_size)); + printf (" tls_start_addr = %s\n", hex_string (d->tls_start_addr)); + printf (" unwind_size = %s\n", hex_string (d->unwind_size)); + printf (" tls_index = %s\n", hex_string (d->tls_index)); } #endif Index: src/gdb/solib-spu.c =================================================================== RCS file: /cvs/src/src/gdb/solib-spu.c,v retrieving revision 1.7 diff -u -p -r1.7 solib-spu.c --- src/gdb/solib-spu.c 9 Mar 2010 18:09:07 -0000 1.7 +++ src/gdb/solib-spu.c 1 Apr 2010 14:06:43 -0000 @@ -161,7 +161,8 @@ spu_current_sos (void) /* Encode FD and object ID in path name. Choose the name so as not to conflict with any (normal) SVR4 library path name. */ - xsnprintf (new->so_name, sizeof new->so_name, "@0x%llx <%d>", addr, fd); + xsnprintf (new->so_name, sizeof new->so_name, "@%s <%d>", + hex_string (addr), fd); strcpy (new->so_original_name, new->so_name); *link_ptr = new; Index: src/gdb/nto-procfs.c =================================================================== RCS file: /cvs/src/src/gdb/nto-procfs.c,v retrieving revision 1.52 diff -u -p -r1.52 nto-procfs.c --- src/gdb/nto-procfs.c 15 Feb 2010 17:35:49 -0000 1.52 +++ src/gdb/nto-procfs.c 1 Apr 2010 14:06:43 -0000 @@ -577,14 +577,14 @@ procfs_meminfo (char *args, int from_tty printme.text.addr); printf_filtered ("\t\tflags=%08x\n", printme.text.flags); printf_filtered ("\t\tdebug=%08x\n", printme.text.debug_vaddr); - printf_filtered ("\t\toffset=%016llx\n", printme.text.offset); + printf_filtered ("\t\toffset=%s\n", phex (printme.text.offset, 8)); if (printme.data.size) { printf_filtered ("\tdata=%08x bytes @ 0x%08x\n", printme.data.size, printme.data.addr); printf_filtered ("\t\tflags=%08x\n", printme.data.flags); printf_filtered ("\t\tdebug=%08x\n", printme.data.debug_vaddr); - printf_filtered ("\t\toffset=%016llx\n", printme.data.offset); + printf_filtered ("\t\toffset=%s\n", phex (printme.data.offset, 8)); } printf_filtered ("\tdev=0x%x\n", printme.dev); printf_filtered ("\tino=0x%x\n", (unsigned int) printme.ino); Index: src/gdb/sh64-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/sh64-tdep.c,v retrieving revision 1.72 diff -u -p -r1.72 sh64-tdep.c --- src/gdb/sh64-tdep.c 1 Jan 2010 07:31:41 -0000 1.72 +++ src/gdb/sh64-tdep.c 1 Apr 2010 14:06:44 -0000 @@ -1330,27 +1330,27 @@ sh64_show_media_regs (struct frame_info int i; printf_filtered - ("PC=%s SR=%016llx \n", + ("PC=%s SR=%s \n", phex (get_frame_register_unsigned (frame, gdbarch_pc_regnum (gdbarch)), 8), - (long long) get_frame_register_unsigned (frame, SR_REGNUM)); + phex (get_frame_register_unsigned (frame, SR_REGNUM), 9)); printf_filtered - ("SSR=%016llx SPC=%016llx \n", - (long long) get_frame_register_unsigned (frame, SSR_REGNUM), - (long long) get_frame_register_unsigned (frame, SPC_REGNUM)); + ("SSR=%s SPC=%s \n", + phex (get_frame_register_unsigned (frame, SSR_REGNUM), 8), + phex (get_frame_register_unsigned (frame, SPC_REGNUM), 8)); printf_filtered - ("FPSCR=%016lx\n ", - (long) get_frame_register_unsigned (frame, FPSCR_REGNUM)); + ("FPSCR=%s\n ", + phex (get_frame_register_unsigned (frame, FPSCR_REGNUM), 8)); for (i = 0; i < 64; i = i + 4) printf_filtered - ("\nR%d-R%d %016llx %016llx %016llx %016llx\n", + ("\nR%d-R%d %s %s %s %s\n", i, i + 3, - (long long) get_frame_register_unsigned (frame, i + 0), - (long long) get_frame_register_unsigned (frame, i + 1), - (long long) get_frame_register_unsigned (frame, i + 2), - (long long) get_frame_register_unsigned (frame, i + 3)); + phex (get_frame_register_unsigned (frame, i + 0), 8), + phex (get_frame_register_unsigned (frame, i + 1), 8), + phex (get_frame_register_unsigned (frame, i + 2), 8), + phex (get_frame_register_unsigned (frame, i + 3), 8)); printf_filtered ("\n");