Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Sherrill <joel.sherrill@oarcorp.com>
To: gdb-patches@sourceware.org,   Ralf Corsepius <ralf.corsepius@rtems.org>
Subject: Re: gdb 6.6 sim/erc32 does not parse -E option
Date: Thu, 22 Feb 2007 18:46:00 -0000	[thread overview]
Message-ID: <45DDE4DE.1090803@oarcorp.com> (raw)
In-Reply-To: <20070222183150.GA17532@caradoc.them.org>

[-- Attachment #1: Type: text/plain, Size: 1137 bytes --]

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
>
>
>   


[-- Attachment #2: new.diff --]
[-- Type: text/x-patch, Size: 1875 bytes --]

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");

  reply	other threads:[~2007-02-22 18:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-22 17:02 Joel Sherrill
2007-02-22 17:12 ` Daniel Jacobowitz
2007-02-22 17:28   ` Joel Sherrill
2007-02-22 18:16     ` Daniel Jacobowitz
2007-02-22 18:26       ` Joel Sherrill
2007-02-22 18:32         ` Daniel Jacobowitz
2007-02-22 18:46           ` Joel Sherrill [this message]
2007-02-22 18:49             ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45DDE4DE.1090803@oarcorp.com \
    --to=joel.sherrill@oarcorp.com \
    --cc=gdb-patches@sourceware.org \
    --cc=ralf.corsepius@rtems.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox