From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24891 invoked by alias); 22 Feb 2007 18:46:01 -0000 Received: (qmail 24883 invoked by uid 22791); 22 Feb 2007 18:46:00 -0000 X-Spam-Check-By: sourceware.org Received: from mail.oarcorp.com (HELO mail.oarcorp.com) (216.186.189.5) by sourceware.org (qpsmtpd/0.31) with SMTP; Thu, 22 Feb 2007 18:45:53 +0000 Received: (qmail 31324 invoked by uid 507); 22 Feb 2007 18:45:51 -0000 Received: from 192.168.1.3 by mail.oarcorp.com (envelope-from , uid 501) with qmail-scanner-1.25st (spamassassin: 3.1.1. perlscan: 1.25st. Clear:RC:1(192.168.1.3):. Processed in 0.038412 secs); 22 Feb 2007 18:45:51 -0000 X-Qmail-Scanner-Mail-From: joel.sherrill@oarcorp.com via mail.oarcorp.com X-Qmail-Scanner: 1.25st (Clear:RC:1(192.168.1.3):. Processed in 0.038412 secs Process 31317) Received: from unknown (HELO ?192.168.1.3?) (192.168.1.3) by mail.oarcorp.com with SMTP; 22 Feb 2007 18:45:51 -0000 Message-ID: <45DDE4DE.1090803@oarcorp.com> Date: Thu, 22 Feb 2007 18:46:00 -0000 From: Joel Sherrill User-Agent: Thunderbird 1.5.0.9 (X11/20070102) MIME-Version: 1.0 To: gdb-patches@sourceware.org, Ralf Corsepius Subject: Re: gdb 6.6 sim/erc32 does not parse -E option References: <45DDCCAE.9060801@oarcorp.com> <20070222171239.GA13379@caradoc.them.org> <45DDD2C6.4080606@oarcorp.com> <20070222181601.GA16625@caradoc.them.org> <45DDE051.4090103@oarcorp.com> <20070222183150.GA17532@caradoc.them.org> In-Reply-To: <20070222183150.GA17532@caradoc.them.org> Content-Type: multipart/mixed; boundary="------------040403090304060504030908" 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: 2007-02/txt/msg00280.txt.bz2 This is a multi-part message in MIME format. --------------040403090304060504030908 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1137 Daniel Jacobowitz wrote: > On Thu, Feb 22, 2007 at 12:26:25PM -0600, Joel Sherrill wrote: > >> Daniel Jacobowitz wrote: >> >>> On Thu, Feb 22, 2007 at 11:28:38AM -0600, Joel Sherrill wrote: >>> >>> >>>> With this patch, gdb still passes a -E big to sim_open in the erc32 >>>> simulator code and there is nothing to parse it at that level. >>>> >>>> >>> It shouldn't do that. If it does, please show me a complete GDB >>> session. >>> >>> >>> >> I double checked that the patch is applied and >> had made clean before the last email. Here is >> the user's view: >> > > Oh sorry for making you run around in circles. I knew I needed to fix > something, that's why I hadn't applied it yet. It was pointed out > that it needs: > > - if (target_byte_order_user) > + if (target_byte_order_user != BFD_ENDIAN_UNKNOWN) > > That ought to help! > I assumed this went in arch-utils.c and resulted in the attached updated version of your patch. It does seem to work now. If you are happy with the attached patch, then we will make it part of the RTEMS gdb 6.6 patch. Thanks. --joel > > > --------------040403090304060504030908 Content-Type: text/x-patch; name="new.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="new.diff" Content-length: 1875 diff -ur gdb-6.6-orig/gdb/arch-utils.c gdb-6.6/gdb/arch-utils.c --- gdb-6.6-orig/gdb/arch-utils.c 2006-11-10 13:20:35.000000000 -0600 +++ gdb-6.6/gdb/arch-utils.c 2007-02-22 12:43:03.000000000 -0600 @@ -349,6 +349,15 @@ }; static const char *set_endian_string; +enum bfd_endian +selected_byte_order (void) +{ + if (target_byte_order_user != BFD_ENDIAN_UNKNOWN) + return TARGET_BYTE_ORDER; + else + return BFD_ENDIAN_UNKNOWN; +} + /* Called by ``show endian''. */ static void Only in gdb-6.6/gdb: arch-utils.c.orig diff -ur gdb-6.6-orig/gdb/arch-utils.h gdb-6.6/gdb/arch-utils.h --- gdb-6.6-orig/gdb/arch-utils.h 2006-11-10 13:20:35.000000000 -0600 +++ gdb-6.6/gdb/arch-utils.h 2007-02-22 11:23:31.000000000 -0600 @@ -126,6 +126,10 @@ extern int legacy_register_sim_regno (int regnum); +/* Return the selected byte order, or BFD_ENDIAN_UNKNOWN if no byte + order was explicitly selected. */ +extern enum bfd_endian selected_byte_order (void); + /* Return the selected architecture's name, or NULL if no architecture was explicitly selected. */ extern const char *selected_architecture_name (void); Only in gdb-6.6/gdb: arch-utils.h.orig diff -ur gdb-6.6-orig/gdb/remote-sim.c gdb-6.6/gdb/remote-sim.c --- gdb-6.6-orig/gdb/remote-sim.c 2006-11-10 13:20:36.000000000 -0600 +++ gdb-6.6/gdb/remote-sim.c 2007-02-22 11:23:31.000000000 -0600 @@ -504,9 +504,9 @@ + 50) /* slack */ ; arg_buf = (char *) alloca (len); strcpy (arg_buf, "gdbsim"); /* 7 */ - /* Specify the byte order for the target when it is both selectable - and explicitly specified by the user (not auto detected). */ - switch (TARGET_BYTE_ORDER) + /* Specify the byte order for the target when it is explicitly + specified by the user (not auto detected). */ + switch (selected_byte_order ()) { case BFD_ENDIAN_BIG: strcat (arg_buf, " -E big"); --------------040403090304060504030908--