diff options
author | Andrew Cagney <cagney@redhat.com> | 1997-05-23 09:25:01 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 1997-05-23 09:25:01 +0000 |
commit | 95edd7c1676eb436921679a43f2e51b9cb51b48e (patch) | |
tree | a04c342a1909fbca4d4c01101fdf4362bf4df6bb | |
parent | cd0d873d0fedaf707974d9db43fe69ee52eb90d5 (diff) | |
download | gdb-95edd7c1676eb436921679a43f2e51b9cb51b48e.zip gdb-95edd7c1676eb436921679a43f2e51b9cb51b48e.tar.gz gdb-95edd7c1676eb436921679a43f2e51b9cb51b48e.tar.bz2 |
Don't restrict the endian commands to BI-ENDIAN gdb.
-rw-r--r-- | gdb/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/top.c | 37 |
2 files changed, 27 insertions, 18 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 77a9e89..68cdf1a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +Fri May 23 13:51:57 1997 Andrew Cagney <cagney@b1.cygnus.com> + + * top.c (init_cmd_lists): Always initialize endianlist. + (init_main): Always define endian commands. + (set_endian_big): Issue warning if endian not selectable. + (set_endian_little): Ditto. + (set_endian_auto): Ditto. + Thu May 22 11:53:21 1997 Andrew Cagney <cagney@b1.cygnus.com> * remote-sim.c (simulator_command): Restrict access to the @@ -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 |