aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2007-02-26 20:13:18 +0000
committerDaniel Jacobowitz <drow@false.org>2007-02-26 20:13:18 +0000
commitb6d373df1e5729606ff51f3947dd636eab6738b6 (patch)
tree4d83417c0f10a898bcd98764e03cce86189447b1 /gdb
parentc74d0ad8276928d58b080ecd50eb5026aac49c5d (diff)
downloadgdb-b6d373df1e5729606ff51f3947dd636eab6738b6.zip
gdb-b6d373df1e5729606ff51f3947dd636eab6738b6.tar.gz
gdb-b6d373df1e5729606ff51f3947dd636eab6738b6.tar.bz2
* arch-utils.c (selected_byte_order): New.
* arch-utils.h (selected_byte_order): New prototype. * remote-sim.c (gdbsim_open): Use selected_byte_order.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/arch-utils.c9
-rw-r--r--gdb/arch-utils.h4
-rw-r--r--gdb/remote-sim.c6
4 files changed, 22 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9a208d8..137cf70 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2007-02-26 Daniel Jacobowitz <dan@codesourcery.com>
+ * arch-utils.c (selected_byte_order): New.
+ * arch-utils.h (selected_byte_order): New prototype.
+ * remote-sim.c (gdbsim_open): Use selected_byte_order.
+
+2007-02-26 Daniel Jacobowitz <dan@codesourcery.com>
+
* symfile.c (place_section): Check SEC_ALLOC. Do not check VMA.
(default_symfile_offsets): Check VMA here. Update section VMAs.
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 1a987f3..1ec3c37 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -287,6 +287,15 @@ static const char *endian_enum[] =
};
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
diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h
index d995fcb..d528d67 100644
--- a/gdb/arch-utils.h
+++ b/gdb/arch-utils.h
@@ -118,6 +118,10 @@ int default_remote_register_number (struct gdbarch *gdbarch,
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);
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index b499066..4ec63d5 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -504,9 +504,9 @@ gdbsim_open (char *args, int from_tty)
+ 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");