From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26259 invoked by alias); 24 Sep 2008 10:59:17 -0000 Received: (qmail 26250 invoked by uid 22791); 24 Sep 2008 10:59:17 -0000 X-Spam-Check-By: sourceware.org Received: from SAGW-PRIMARY.ARC.COM (HELO sadt-richards.arc.com) (62.189.186.51) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 24 Sep 2008 10:58:27 +0000 Received: from sadt-richards.arc.com (localhost.localdomain [127.0.0.1]) by sadt-richards.arc.com (8.13.8/8.13.8) with ESMTP id m8OAwO9F003804 for ; Wed, 24 Sep 2008 11:58:24 +0100 Received: (from richards@localhost) by sadt-richards.arc.com (8.13.8/8.13.8/Submit) id m8OAwOtB003803 for gdb@sourceware.org; Wed, 24 Sep 2008 11:58:24 +0100 Subject: gdb 6.8 selected_byte_order function From: Richard Stuckey To: gdb@sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 24 Sep 2008 10:59:00 -0000 Message-Id: <1222253904.3506.12.camel@sad-richards.arc.com> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-8.el5_2.2) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-09/txt/msg00128.txt.bz2 Hello, I am currently moving the ARC port of gdb from 6.6 on to 6.8, and I am a little puzzled by the selected_byte_order function in file arch-utils.c; I wonder if anyone could perhaps enlighten me about it. The 6.8 code (this function did not exist in 6.6) is enum bfd_endian selected_byte_order (void) { if (target_byte_order_user !=3D BFD_ENDIAN_UNKNOWN) return gdbarch_byte_order (current_gdbarch); else return BFD_ENDIAN_UNKNOWN; } Given that that the variable =E2=80=98target_byte_order_user =E2=80=98 hold= s the user=E2=80=99s preference as specified by the =E2=80=9Cset endian=E2=80=9D command, it see= ms to me that the code should be if (target_byte_order_user !=3D BFD_ENDIAN_UNKNOWN) return target_byte_order_user; else return gdbarch_byte_order (current_gdbarch); i.e. if the user has explicitly specified the byte order then we use that, otherwise we use the order determined from the current architecture. I can see from the Changelogs, and various pages on the web (like http://sourceware.org/ml/gdb-patches/2006-11/msg00052.html), that this function has a history of change =E2=80=93 so apologies if I have missed ou= t on all the reasoning that has led to the current version of the code! Regards, Richard Stuckey=20