diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-11-13 19:06:26 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-11-13 19:06:26 +0000 |
commit | 0bf40ea4a3f1708cc5260cd74086079851c92c5d (patch) | |
tree | 4fb914730047e5d48eb6eab9280c3a18c65f5298 /gdb/arch-utils.c | |
parent | 35d78f0640d58f5305860dd8bc4d614c9434140f (diff) | |
download | gdb-0bf40ea4a3f1708cc5260cd74086079851c92c5d.tar.gz |
2003-11-13 Andrew Cagney <cagney@redhat.com>
* arch-utils.h (selected_architecture_name): Declare.
(selected_byte_order): Declare.
* arch-utils.c (selected_byte_order): New function.
(selected_architecture_name): New function.
(target_architecture_auto): Make static.
(set_architecture_string): Make static.
(target_byte_order): Make static.
(target_byte_order_auto): Make static.
* gdbarch.sh (TARGET_BYTE_ORDER, TARGET_ARCHITECTURE): Delete
non-multi-arch definition.
(TARGET_ARCHITECTURE_AUTO, TARGET_BYTE_ORDER_AUTO): Delete.
(target_byte_order, target_architecture): Delete declaration.
(target_byte_order_auto, target_architecture_auto): Ditto.
* gdbarch.h: Re-generate.
* remote-sim.c (gdbsim_open): Use "selected_architecture_name" and
"selected_byte_order".
Diffstat (limited to 'gdb/arch-utils.c')
-rw-r--r-- | gdb/arch-utils.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index 8d5720c6295..4234cb6dd63 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -380,8 +380,17 @@ default_stabs_argument_has_addr (struct gdbarch *gdbarch, struct type *type) The choice of initial value is entirely arbitrary. During startup, the function initialize_current_architecture() updates this value based on default byte-order information extracted from BFD. */ -int target_byte_order = BFD_ENDIAN_BIG; -int target_byte_order_auto = 1; +static int target_byte_order = BFD_ENDIAN_BIG; +static int target_byte_order_auto = 1; + +enum bfd_endian +selected_byte_order (void) +{ + if (target_byte_order_auto) + return BFD_ENDIAN_UNKNOWN; + else + return target_byte_order; +} static const char endian_big[] = "big"; static const char endian_little[] = "little"; @@ -400,7 +409,7 @@ static const char *set_endian_string; static void show_endian (char *args, int from_tty) { - if (TARGET_BYTE_ORDER_AUTO) + if (target_byte_order_auto) printf_unfiltered ("The target endianness is set automatically (currently %s endian)\n", (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? "big" : "little")); else @@ -443,9 +452,18 @@ set_endian (char *ignore_args, int from_tty, struct cmd_list_element *c) enum set_arch { set_arch_auto, set_arch_manual }; -int target_architecture_auto = 1; +static int target_architecture_auto = 1; + +static const char *set_architecture_string; -const char *set_architecture_string; +const char * +selected_architecture_name (void) +{ + if (target_architecture_auto) + return NULL; + else + return set_architecture_string; +} /* Called if the user enters ``show architecture'' without an argument. */ |