aboutsummaryrefslogtreecommitdiff
path: root/gdb/top.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1997-05-23 09:25:01 +0000
committerAndrew Cagney <cagney@redhat.com>1997-05-23 09:25:01 +0000
commit95edd7c1676eb436921679a43f2e51b9cb51b48e (patch)
treea04c342a1909fbca4d4c01101fdf4362bf4df6bb /gdb/top.c
parentcd0d873d0fedaf707974d9db43fe69ee52eb90d5 (diff)
downloadgdb-95edd7c1676eb436921679a43f2e51b9cb51b48e.zip
gdb-95edd7c1676eb436921679a43f2e51b9cb51b48e.tar.gz
gdb-95edd7c1676eb436921679a43f2e51b9cb51b48e.tar.bz2
Don't restrict the endian commands to BI-ENDIAN gdb.
Diffstat (limited to 'gdb/top.c')
-rw-r--r--gdb/top.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/gdb/top.c b/gdb/top.c
index c50864b..3a4f4b1 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -108,8 +108,6 @@ static void init_signals PARAMS ((void));
static void set_verbose PARAMS ((char *, int, struct cmd_list_element *));
-#ifdef TARGET_BYTE_ORDER_SELECTABLE
-
static void set_endian PARAMS ((char *, int));
static void set_endian_big PARAMS ((char *, int));
@@ -120,8 +118,6 @@ static void set_endian_auto PARAMS ((char *, int));
static void show_endian PARAMS ((char *, int));
-#endif
-
static void show_history PARAMS ((char *, int));
static void set_history PARAMS ((char *, int));
@@ -237,11 +233,9 @@ struct cmd_list_element *unsetlist;
struct cmd_list_element *showlist;
-#ifdef TARGET_BYTE_ORDER_SELECTABLE
/* Chain containing the \"set endian\" commands. */
struct cmd_list_element *endianlist;
-#endif
/* Chain containing all defined \"set history\". */
@@ -3120,17 +3114,17 @@ dont_repeat_command (ignored, from_tty)
necessarily reading from stdin. */
}
-#ifdef TARGET_BYTE_ORDER_SELECTABLE
-
/* Functions to manipulate the endianness of the target. */
+#ifdef TARGET_BYTE_ORDER_SELECTABLE
#ifndef TARGET_BYTE_ORDER_DEFAULT
#define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN
#endif
-
int target_byte_order = TARGET_BYTE_ORDER_DEFAULT;
-
static int target_byte_order_auto = 1;
+#else
+static int target_byte_order_auto = 0;
+#endif
/* Called if the user enters ``set endian'' without an argument. */
static void
@@ -3148,8 +3142,13 @@ set_endian_big (args, from_tty)
char *args;
int from_tty;
{
+#ifdef TARGET_BYTE_ORDER_SELECTABLE
target_byte_order = BIG_ENDIAN;
target_byte_order_auto = 0;
+#else
+ printf_unfiltered ("Byte order is not selectable.");
+ show_endian (args, from_tty);
+#endif
}
/* Called by ``set endian little''. */
@@ -3158,8 +3157,13 @@ set_endian_little (args, from_tty)
char *args;
int from_tty;
{
+#ifdef TARGET_BYTE_ORDER_SELECTABLE
target_byte_order = LITTLE_ENDIAN;
target_byte_order_auto = 0;
+#else
+ printf_unfiltered ("Byte order is not selectable.");
+ show_endian (args, from_tty);
+#endif
}
/* Called by ``set endian auto''. */
@@ -3168,7 +3172,12 @@ set_endian_auto (args, from_tty)
char *args;
int from_tty;
{
+#ifdef TARGET_BYTE_ORDER_SELECTABLE
target_byte_order_auto = 1;
+#else
+ printf_unfiltered ("Byte order is not selectable.");
+ show_endian (args, from_tty);
+#endif
}
/* Called by ``show endian''. */
@@ -3184,8 +3193,6 @@ show_endian (args, from_tty)
printf_unfiltered ((char *) msg, TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little");
}
-#endif /* defined (TARGET_BYTE_ORDER_SELECTABLE) */
-
/* Set the endianness from a BFD. */
void
set_endian_from_file (abfd)
@@ -3386,9 +3393,7 @@ init_cmd_lists ()
setlist = NULL;
unsetlist = NULL;
showlist = NULL;
-#ifdef TARGET_BYTE_ORDER_SELECTABLE
endianlist = NULL;
-#endif
sethistlist = NULL;
showhistlist = NULL;
unsethistlist = NULL;
@@ -3439,8 +3444,6 @@ init_main ()
{
struct cmd_list_element *c;
-#ifdef TARGET_BYTE_ORDER_SELECTABLE
-
add_prefix_cmd ("endian", class_support, set_endian,
"Set endianness of target.",
&endianlist, "set endian ", 0, &setlist);
@@ -3453,8 +3456,6 @@ init_main ()
add_cmd ("endian", class_support, show_endian,
"Show endianness of target.", &showlist);
-#endif /* defined (TARGET_BYTE_ORDER_SELECTABLE) */
-
#ifdef DEFAULT_PROMPT
prompt = savestring (DEFAULT_PROMPT, strlen(DEFAULT_PROMPT));
#else