From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22832 invoked by alias); 6 Jun 2012 21:34:41 -0000 Received: (qmail 22541 invoked by uid 22791); 6 Jun 2012 21:34:39 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,TW_XS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 06 Jun 2012 21:34:25 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q56LYP6i007344 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 6 Jun 2012 17:34:25 -0400 Received: from host2.jankratochvil.net (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q56LYKL1002466 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 6 Jun 2012 17:34:23 -0400 Date: Wed, 06 Jun 2012 21:34:00 -0000 From: Jan Kratochvil To: Siddhesh Poyarekar Cc: gdb-patches@sourceware.org, Tom Tromey Subject: Re: [PATCH v3] Expand bitpos and type.length to LONGEST and ULONGEST Message-ID: <20120606213420.GA9219@host2.jankratochvil.net> References: <20120221210235.GA26897@host2.jankratochvil.net> <20120504183858.67d416b7@spoyarek> <20120515200454.GA11338@host2.jankratochvil.net> <20120523192245.0f785e69@spoyarek> <20120523174610.GA23405@host2.jankratochvil.net> <20120524070634.4e346d9d@spoyarek> <20120524150105.GA8232@host2.jankratochvil.net> <20120531234422.3ea35cde@spoyarek> <20120605222651.GA25480@host2.jankratochvil.net> <20120606235335.7fa94030@spoyarek> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120606235335.7fa94030@spoyarek> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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: 2012-06/txt/msg00203.txt.bz2 @@ -7968,7 +7968,7 @@ remote_insert_watchpoint (CORE_ADDR addr, int len, int type, [...] - xsnprintf (p, endbuf - p, ",%x", len); + xsnprintf (p, endbuf - p, ",%s", int_string (len, 16, 1, 0, 0)); [...] @@ -8012,7 +8012,7 @@ remote_remove_watchpoint (CORE_ADDR addr, int len, int type, [...] - xsnprintf (p, endbuf - p, ",%x", len); + xsnprintf (p, endbuf - p, ",%s", int_string (len, 16, 1, 0, 0)); int_string does not support IS_SIGNED (1) for RADIX 16 anyway. So I would simplify it just by using: + xsnprintf (p, endbuf - p, ",%s", phex_nz (len, 8)); --- a/gdb/rx-tdep.c +++ b/gdb/rx-tdep.c @@ -710,10 +710,10 @@ rx_return_value (struct gdbarch *gdbarch, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); ULONGEST valtype_len = TYPE_LENGTH (valtype); - if (TYPE_LENGTH (valtype) > 16 + if (valtype_len > 16 || ((TYPE_CODE (valtype) == TYPE_CODE_STRUCT || TYPE_CODE (valtype) == TYPE_CODE_UNION) - && TYPE_LENGTH (valtype) % 4 != 0)) + && valtype_len % 4 != 0)) return RETURN_VALUE_STRUCT_CONVENTION; This seems to be an unrelated cleanup, just drop it. @@ -1763,9 +1764,10 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch, { struct value *arg = args[i]; struct type *arg_type = check_typedef (value_type (arg)); - fprintf_unfiltered (gdb_stdlog, "%2d: %s %3d ", i, + fprintf_unfiltered (gdb_stdlog, "%2d: %s %s ", i, host_address_to_string (arg), - TYPE_LENGTH (arg_type)); + int_string (TYPE_LENGTH (arg_type), 10, 0, 3, + 0)); It is sure just for debugging but this is an output change due to zeroes padding. What about putting there instead: const char *arg_type_len_s = pulongest (TYPE_LENGTH (arg_type)); + fprintf_unfiltered (gdb_stdlog, "%2d: %s %s ", i, [...] arg_type_len_s); Used: rm -rf splint/;mkdir -p splint/bits;touch splint/bits/confname.h;for i in `cat files`;do mkdir -p splint/`dirname $i`;splint +posixlib +gnuextensions -Isplint -exportlocal -DTUI -I. -Icommon -I../include -I../bfd -I../libdecnumber -I../opcodes -I.. -I/usr/include/python2.7 $i &>splint/$i.out;done find splint-bitpos/ -type f|sort|xargs cat|perl -lpe 's/^\s*(\S*?\.[ch]:\d+:\d+):/LOC $1\n/' >splint-bitpos.out diff -I"^LOC " splint-clean.out splint-bitpos.out|vim - and got for example: -LOC ada-lang.c:669:33 +LOC ada-lang.c:670:33 Function umax_of_size expects arg 1 to be int gets unsigned - int: (t)->length + long int: (t)->length It has 26000 lines this way, I will try to reduce the diff size somehow. Thanks, Jan