From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22538 invoked by alias); 20 Jan 2002 19:00:37 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 22504 invoked from network); 20 Jan 2002 19:00:34 -0000 Received: from unknown (HELO localhost.cygnus.com) (24.114.42.213) by sources.redhat.com with SMTP; 20 Jan 2002 19:00:34 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.cygnus.com (Postfix) with ESMTP id 0BA7C3F0A; Sun, 20 Jan 2002 14:00:34 -0500 (EST) Message-ID: <3C4B13D1.90007@cygnus.com> Date: Sun, 20 Jan 2002 11:00:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.7) Gecko/20020103 X-Accept-Language: en-us MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: [patch/rfc] Eliminate TARGET_BYTE_ORDER_SELECTABLE References: <3C490B0C.6090601@cygnus.com> <20020119094718.A1404@nevyn.them.org> <3C49A566.1060508@cygnus.com> <20020119120032.A19415@nevyn.them.org> <3C4B0D79.4070005@cygnus.com> <20020120133632.A22738@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-01/txt/msg00580.txt.bz2 > On Sun, Jan 20, 2002 at 01:33:29PM -0500, Andrew Cagney wrote: > >> > >> >Woah! That's neat! I need to remember that :) >> > >> >And I suppose I of all people shouldn't be griping about allowing more >> >endianness choices. I have a patch here to support big-endian >> >ARM/Linux. All I did was change TARGET_BYTE_ORDER_*. > >> >> >> Delete it :-) As Michael observed, if the code is written correctly it >> works from day one. (Problem is it has taken ~10 years to figure out >> how to correctly write the code :-) > > > Well, I need to set TARGET_BYTE_ORDER_DEFAULT. If you start a cross > debugger without giving it a binary, and attach to a random remote > target, then we need to default to the right one. Other than that > everything is fine, though! Nope! I'm about to delete TARGET_BYTE_ORDER_DEFAULT. There is this really nasty bit of code in arch-utils.c that roots around the internals of BFD and uses that to determine the initial architecture and byte-order. Doing this ensures that GDB's behavour is better aligned with that of BINUTILS. See arch-utils.c:initialize_current_architecture(). If GDB initializes its self to the wrong byte-order then there is likely a bug in BFD. Did I mention that we live in dangerous times :-) Andrew PS: Actually the code isn't that bad. What makes it nasty is the need to prop up the old non-multi-arch behavour.