aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>1999-10-26 03:43:48 +0000
committerJason Molenda <jmolenda@apple.com>1999-10-26 03:43:48 +0000
commite514a9d64262fcceccd85180b20b7adc3c4a5eed (patch)
tree15fda31e24d9ce88756ba5e4d3c6a54711e8648e /gdb/gdbarch.c
parent4c1102fd195c4ec6aaff893d5d4df4fc5faa0fc1 (diff)
downloadfsf-binutils-gdb-e514a9d64262fcceccd85180b20b7adc3c4a5eed.zip
fsf-binutils-gdb-e514a9d64262fcceccd85180b20b7adc3c4a5eed.tar.gz
fsf-binutils-gdb-e514a9d64262fcceccd85180b20b7adc3c4a5eed.tar.bz2
import gdb-1999-10-25 snapshot
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 54fd444..f7fbea4 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -3161,6 +3161,35 @@ int sizeof_call_dummy_words = sizeof (call_dummy_words);
#endif
+/* Initialize the current architecture. */
+void
+initialize_current_architecture ()
+{
+ if (GDB_MULTI_ARCH)
+ {
+ struct gdbarch_init_registration *rego;
+ const struct bfd_arch_info *chosen = NULL;
+ for (rego = gdbarch_init_registrary; rego != NULL; rego = rego->next)
+ {
+ const struct bfd_arch_info *ap
+ = bfd_lookup_arch (rego->bfd_architecture, 0);
+
+ /* Choose the first architecture alphabetically. */
+ if (chosen == NULL
+ || strcmp (ap->printable_name, chosen->printable_name) < 0)
+ chosen = ap;
+ }
+
+ if (chosen != NULL)
+ {
+ struct gdbarch_info info;
+ memset (&info, 0, sizeof info);
+ info.bfd_arch_info = chosen;
+ gdbarch_update (info);
+ }
+ }
+}
+
extern void _initialize_gdbarch (void);
void
_initialize_gdbarch ()