From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24770 invoked by alias); 31 Aug 2008 17:52:38 -0000 Received: (qmail 24061 invoked by uid 22791); 31 Aug 2008 17:52:28 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate3.de.ibm.com (HELO mtagate3.de.ibm.com) (195.212.29.152) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 31 Aug 2008 17:51:40 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate3.de.ibm.com (8.13.8/8.13.8) with ESMTP id m7VHpb3M250084 for ; Sun, 31 Aug 2008 17:51:37 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m7VHpaQr3743800 for ; Sun, 31 Aug 2008 19:51:36 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m7VHpakc020249 for ; Sun, 31 Aug 2008 19:51:36 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m7VHpae7020246 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 31 Aug 2008 19:51:36 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (localhost.localdomain [127.0.0.1]) by tuxmaker.boeblingen.de.ibm.com (8.13.8/8.13.8) with ESMTP id m7VHpakD003055 for ; Sun, 31 Aug 2008 19:51:36 +0200 Received: (from uweigand@localhost) by tuxmaker.boeblingen.de.ibm.com (8.13.8/8.13.8/Submit) id m7VHpakw003054 for gdb-patches@sourceware.org; Sun, 31 Aug 2008 19:51:36 +0200 Message-Id: <20080831175136.145193000@de.ibm.com> References: <20080831175045.128504000@de.ibm.com> User-Agent: quilt/0.46-1 Date: Sun, 31 Aug 2008 17:52:00 -0000 From: uweigand@de.ibm.com To: gdb-patches@sourceware.org Subject: [rfc][29/37] Eliminate builtin_type_ macros: Update valarith.c routines Content-Disposition: inline; filename=diff-type-valarith 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: 2008-08/txt/msg00687.txt.bz2 Hello, this removes the last remaining instances of builtin_type_ in valarith.c. value_x_unop can simply use a platform-neutral type for the constant 0 argument ot the UNOP_POSTINCREMENT/UNOP_POSTDECREMENT operator inferior calls; call_function_by_hand will take care of promoting this to the proper architecture-specific type when performing the call. value_bit_index only wants to access one single target byte; there is no need to use an architecture-specific type to do so. Bye, Ulrich ChangeLog: * valarith.c (value_x_unop): Use builtin_type_int8 as type for UNOP_POSTINCREMENT/UNOP_POSTDECREMENT constant 0 argument. (value_bit_index): Use extract_unsigned_integer instead of unpack_long to read single byte. Index: gdb-head/gdb/valarith.c =================================================================== --- gdb-head.orig/gdb/valarith.c +++ gdb-head/gdb/valarith.c @@ -541,13 +541,13 @@ value_x_unop (struct value *arg1, enum e break; case UNOP_POSTINCREMENT: strcpy (ptr, "++"); - argvec[2] = value_from_longest (builtin_type_int, 0); + argvec[2] = value_from_longest (builtin_type_int8, 0); argvec[3] = 0; nargs ++; break; case UNOP_POSTDECREMENT: strcpy (ptr, "--"); - argvec[2] = value_from_longest (builtin_type_int, 0); + argvec[2] = value_from_longest (builtin_type_int8, 0); argvec[3] = 0; nargs ++; break; @@ -1558,8 +1558,7 @@ value_bit_index (struct type *type, cons if (index < low_bound || index > high_bound) return -1; rel_index = index - low_bound; - word = unpack_long (builtin_type_unsigned_char, - valaddr + (rel_index / TARGET_CHAR_BIT)); + word = extract_unsigned_integer (valaddr + (rel_index / TARGET_CHAR_BIT), 1); rel_index %= TARGET_CHAR_BIT; if (gdbarch_bits_big_endian (current_gdbarch)) rel_index = TARGET_CHAR_BIT - 1 - rel_index; -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com