diff options
author | Andrew Cagney <cagney@redhat.com> | 1998-12-18 03:21:45 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 1998-12-18 03:21:45 +0000 |
commit | 2e64ee9aae3cc3061f14c4cd1283b67a8c68d4a4 (patch) | |
tree | acb5c04b4f4c52a1a0c370f67b7b144bea58860a /gdb/gdbarch.c | |
parent | 492eae092d30d43aa13c1c39fbd167706c685e76 (diff) | |
download | gdb-2e64ee9aae3cc3061f14c4cd1283b67a8c68d4a4.zip gdb-2e64ee9aae3cc3061f14c4cd1283b67a8c68d4a4.tar.gz gdb-2e64ee9aae3cc3061f14c4cd1283b67a8c68d4a4.tar.bz2 |
CARP:
Pass gdbarch_info by value to the arch init function.
Review doco.
Update mips-tdep.c
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r-- | gdb/gdbarch.c | 59 |
1 files changed, 48 insertions, 11 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 263ee73..4fa8653 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -62,12 +62,12 @@ struct gdbarch When adding to the below you must also: declare/define set/get value functions; override the corresponding macro in gdbarch.h; - initialize the value in gdbarch_alloc() (if zero is an unsuitable - default); confirm that the target updated the value correctly in - verify_gdbarch(); add a fprintf_unfiltered call to + if zero/NULL is not a suitable default, initialize the field in + gdbarch_alloc(); confirm that the target updated the value + correctly in verify_gdbarch(); add a fprintf_unfiltered call to gdbarch_update() so that the new field is dumped out; append an - initial value to the static variable DEFAULT_GDBARCH (base values - on the host's c-type system). */ + initial value to the static variable ``default_gdbarch'' (base + values on the host's c-type system). */ int long_bit; int long_long_bit; @@ -478,8 +478,33 @@ gdbarch_update (info) return 0; } + if (gdbarch_debug) + { + fprintf_unfiltered (stderr, + "gdbarch_update: info.bfd_architecture %d (%s)\n", + info.bfd_architecture, + bfd_lookup_arch (info.bfd_architecture, 0)->printable_name); + fprintf_unfiltered (stderr, + "gdbarch_update: info.bfd_arch_info %s\n", + (info.bfd_arch_info != NULL + ? info.bfd_arch_info->printable_name + : "(null)")); + fprintf_unfiltered (stderr, + "gdbarch_update: info.byte_order %d (%s)\n", + info.byte_order, + (info.byte_order == BIG_ENDIAN ? "big" + : info.byte_order == LITTLE_ENDIAN ? "little" + : "default")); + fprintf_unfiltered (stderr, + "gdbarch_update: info.abfd 0x%lx\n", + (long) info.abfd); + fprintf_unfiltered (stderr, + "gdbarch_update: info.tdep_info 0x%lx\n", + (long) info.tdep_info); + } + /* Ask the target for a replacement architecture. */ - new_gdbarch = rego->init (&info, rego->arches); + new_gdbarch = rego->init (info, rego->arches); /* Did the target like it? No. Reject the change. */ if (new_gdbarch == NULL) @@ -528,13 +553,25 @@ gdbarch_update (info) current_gdbarch = new_gdbarch; if (gdbarch_debug) { - fprintf_unfiltered (stderr, "gdbarch_update: New architecture 0x%08lx (%s) selected\n", + fprintf_unfiltered (stderr, + "gdbarch_update: New architecture 0x%08lx (%s) selected\n", (long) new_gdbarch, new_gdbarch->bfd_arch_info->printable_name); - fprintf_unfiltered (stderr, "TARGET_BYTE_ORDER = %d\n", TARGET_BYTE_ORDER); - fprintf_unfiltered (stderr, "TARGET_LONG_BIT = %d\n", TARGET_LONG_BIT); - fprintf_unfiltered (stderr, "TARGET_LONG_LONG_BIT = %d\n", TARGET_LONG_LONG_BIT); - fprintf_unfiltered (stderr, "TARGET_PTR_BIT = %d\n", TARGET_PTR_BIT); + fprintf_unfiltered (stderr, + "gdbarch_update: TARGET_BYTE_ORDER = %d (%s)\n", + TARGET_BYTE_ORDER, + (TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" + : TARGET_BYTE_ORDER == LITTLE_ENDIAN ? "little" + : "default")); + fprintf_unfiltered (stderr, + "gdbarch_update: TARGET_LONG_BIT = %d\n", + TARGET_LONG_BIT); + fprintf_unfiltered (stderr, + "gdbarch_update: TARGET_LONG_LONG_BIT = %d\n", + TARGET_LONG_LONG_BIT); + fprintf_unfiltered (stderr, + "gdbarch_update: TARGET_PTR_BIT = %d\n", + TARGET_PTR_BIT); } /* Check that the newly installed architecture is valid. */ |