From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29195 invoked by alias); 23 Oct 2009 22:37:48 -0000 Received: (qmail 29181 invoked by uid 22791); 23 Oct 2009 22:37:46 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.115.85.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 23 Oct 2009 22:37:41 +0000 Received: from jupiter.vmware.com (mailhost5.vmware.com [10.16.68.131]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 7E1CD13087; Fri, 23 Oct 2009 15:37:39 -0700 (PDT) Received: from [10.20.94.141] (msnyder-server.eng.vmware.com [10.20.94.141]) by jupiter.vmware.com (Postfix) with ESMTP id 71796DC05E; Fri, 23 Oct 2009 15:37:39 -0700 (PDT) Message-ID: <4AE22E96.5010309@vmware.com> Date: Fri, 23 Oct 2009 22:37:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: Pedro Alves CC: "gdb-patches@sourceware.org" , Pierre Muller Subject: Re: New ARI regression Fri Oct 23 01:57:01 UTC 2009 References: <20091023015701.GA26378@sourceware.org> <200910231750.54862.pedro@codesourcery.com> <4AE1E3FD.7050203@vmware.com> <200910231949.35405.pedro@codesourcery.com> In-Reply-To: <200910231949.35405.pedro@codesourcery.com> Content-Type: multipart/mixed; boundary="------------030908020901050606070900" 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: 2009-10/txt/msg00604.txt.bz2 This is a multi-part message in MIME format. --------------030908020901050606070900 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 400 Pedro Alves wrote: > These functions aren't always "network order" now, and are > hence misnamed. Rename or eliminate them by inlining they > bodies at the call sites. Alternatively, if you wanted to > keep using "netorder", you could just simply always > hardcode BFD_ENDIAN_BIG, or pull htonl from gnulib. > Yeah. Sorry for all the back-and-forth. I like the last idea. How's this patch? --------------030908020901050606070900 Content-Type: text/plain; name="bigend.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="bigend.txt" Content-length: 1775 2009-10-23 Michael Snyder * record.c (top level): Don't include byteswap.h. (netorder64): Use store_unsigned_integer instead of bswap_64. (netorder32): Use store_unsigned_integer instead of bswap_32. (netorder16): Use store_unsigned_integer instead of bswap_16. Index: record.c =================================================================== RCS file: /cvs/src/src/gdb/record.c,v retrieving revision 1.34 diff -u -p -r1.34 record.c --- record.c 23 Oct 2009 17:12:25 -0000 1.34 +++ record.c 23 Oct 2009 22:33:56 -0000 @@ -31,7 +31,6 @@ #include "elf-bfd.h" #include "gcore.h" -#include #include /* This module implements "target record", also known as "process @@ -1956,27 +1955,33 @@ bfdcore_read (bfd *obfd, asection *osec, } static inline uint64_t -netorder64 (uint64_t fromfile) +netorder64 (uint64_t input) { - return (BYTE_ORDER == BFD_ENDIAN_LITTLE) - ? bswap_64 (fromfile) - : fromfile; + uint64_t ret; + + store_unsigned_integer ((gdb_byte *) &ret, sizeof (ret), + BFD_ENDIAN_BIG, input); + return ret; } static inline uint32_t -netorder32 (uint32_t fromfile) +netorder32 (uint32_t input) { - return (BYTE_ORDER == BFD_ENDIAN_LITTLE) - ? bswap_32 (fromfile) - : fromfile; + uint32_t ret; + + store_unsigned_integer ((gdb_byte *) &ret, sizeof (ret), + BFD_ENDIAN_BIG, input); + return ret; } static inline uint16_t -netorder16 (uint16_t fromfile) +netorder16 (uint16_t input) { - return (BYTE_ORDER == BFD_ENDIAN_LITTLE) - ? bswap_16 (fromfile) - : fromfile; + uint16_t ret; + + store_unsigned_integer ((gdb_byte *) &ret, sizeof (ret), + BFD_ENDIAN_BIG, input); + return ret; } /* Restore the execution log from a core_bfd file. */ --------------030908020901050606070900--