aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2002-12-21 19:58:07 +0000
committerMark Kettenis <kettenis@gnu.org>2002-12-21 19:58:07 +0000
commit05816f706ec4cb2e789828fa8edb8ea30593933b (patch)
treee6e08df1755b4df8667a796d3c271bb99031d55b
parent743b930b5935b474bec050a1598344b8580eaab9 (diff)
downloadgdb-05816f706ec4cb2e789828fa8edb8ea30593933b.zip
gdb-05816f706ec4cb2e789828fa8edb8ea30593933b.tar.gz
gdb-05816f706ec4cb2e789828fa8edb8ea30593933b.tar.bz2
* osabi.c: Include "gdb_assert.h" and "gdb_string.h".
(struct gdb_osabi_handler): Remove member `arch'. Add member `arch_info'. (gdbarch_register_osabi): Add new argument `machine'. Use ot to construct a `struct bfd_arch_info' and store it in the `struct gdb_osabi_handler' that is created. (gdbarch_init_osabi): Check for compatibility based on machine type and architecture. * osabi.h (gdbarch_register_osabi): Adjust prototype and update comment. * alpha-linux-tdep.c (_initialize_alpha_linux_tdep): Add 0 as second argument in call to gdbarch_register_osabi. * alpha-osf1-tdep.c (_initialize_alpha_osf1_tdep): Likewise. * alphafbsd-tdep.c (_initialize_alphafbsd_tdep): Likewise. * alphanbsd-tdep.c (_initialize_alphanbsd_tdep): Likewise. * arm-linux-tdep.c (_initialize_arm_linux_tdep): Likewise. * arm-tdep.c (_initialize_arm_tdep): Likewise. * armnbsd-tdep.c (_initialize_armnbsd_tdep): Likewise. * hppa-hpux-tdep.c (_initialize_hppa_hpux_tdep): Likewise. * i386-interix-tdep.c (_initialize_i386_interix_tdep): Likewise. * i386-linux-tdep.c (_initialize_i386_linux_tdep): Likewise. * i386-sol2-tdep.c (_initialize_i386_sol2_tdep): Likewise. * i386-tdep.c (_initialize_i386_tdep): Likewise. * i386bsd-tdep.c (_initialize_i386bsd_tdep): Likewise. * i386gnu-tdep.c (_initialize_i386gnu_tdep): Likewise. * i386ly-tdep.c (_initialize_i386lynx_tdep): Renamed from _initialize_i386bsd_tdep and updated likewise. * i386nbsd-tdep.c (_initialize_i386nbsd_tdep): Likewise. * i386obsd-tdep.c (_initialize_i386obsd_tdep): Likewise. * mips-irix-tdep.c (_initialize_mips_irix_tdep): Likewise. * mips-linux-tdep.c (_initialize_mips_linux_tdep): Likewise. * mipsnbsd-tdep.c (_initialize_mipsnbsd__tdep): Likewise. * ns32knbsd-tdep.c (_initialize_ns32kmnsd_tdep): Likewise. * ppc-linux-tdep.c (_initialize_ppc_linux_tdep): Likewise. * ppcnbsd-tdep.c (_initialize_ppcnbsd_tdep): Likewise. * shnbsd-tdep.c (_initialize_shnbsd_tdep): Likewise. * sparcnbsd-tdep.c (_initialize_sparcnbsd_tdep): Likewise.
-rw-r--r--gdb/ChangeLog40
-rw-r--r--gdb/alpha-linux-tdep.c2
-rw-r--r--gdb/alpha-osf1-tdep.c3
-rw-r--r--gdb/alphafbsd-tdep.c2
-rw-r--r--gdb/alphanbsd-tdep.c2
-rw-r--r--gdb/arm-linux-tdep.c3
-rw-r--r--gdb/arm-tdep.c6
-rw-r--r--gdb/armnbsd-tdep.c4
-rw-r--r--gdb/hppa-hpux-tdep.c5
-rw-r--r--gdb/i386-interix-tdep.c2
-rw-r--r--gdb/i386-linux-tdep.c2
-rw-r--r--gdb/i386-sol2-tdep.c2
-rw-r--r--gdb/i386-tdep.c6
-rw-r--r--gdb/i386bsd-tdep.c4
-rw-r--r--gdb/i386gnu-tdep.c2
-rw-r--r--gdb/i386ly-tdep.c4
-rw-r--r--gdb/i386nbsd-tdep.c4
-rw-r--r--gdb/i386obsd-tdep.c2
-rw-r--r--gdb/mips-irix-tdep.c2
-rw-r--r--gdb/mips-linux-tdep.c2
-rw-r--r--gdb/mipsnbsd-tdep.c2
-rw-r--r--gdb/ns32knbsd-tdep.c2
-rw-r--r--gdb/osabi.c38
-rw-r--r--gdb/osabi.h8
-rw-r--r--gdb/ppc-linux-tdep.c2
-rw-r--r--gdb/ppcnbsd-tdep.c2
-rw-r--r--gdb/shnbsd-tdep.c3
-rw-r--r--gdb/sparcnbsd-tdep.c4
28 files changed, 111 insertions, 49 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c3ab184..c7ab93c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,43 @@
+2002-12-14 Mark Kettenis <kettenis@gnu.org>
+
+ * osabi.c: Include "gdb_assert.h" and "gdb_string.h".
+ (struct gdb_osabi_handler): Remove member `arch'. Add member
+ `arch_info'.
+ (gdbarch_register_osabi): Add new argument `machine'. Use ot to
+ construct a `struct bfd_arch_info' and store it in the `struct
+ gdb_osabi_handler' that is created.
+ (gdbarch_init_osabi): Check for compatibility based on machine
+ type and architecture.
+ * osabi.h (gdbarch_register_osabi): Adjust prototype and update
+ comment.
+ * alpha-linux-tdep.c (_initialize_alpha_linux_tdep): Add 0 as
+ second argument in call to gdbarch_register_osabi.
+ * alpha-osf1-tdep.c (_initialize_alpha_osf1_tdep): Likewise.
+ * alphafbsd-tdep.c (_initialize_alphafbsd_tdep): Likewise.
+ * alphanbsd-tdep.c (_initialize_alphanbsd_tdep): Likewise.
+ * arm-linux-tdep.c (_initialize_arm_linux_tdep): Likewise.
+ * arm-tdep.c (_initialize_arm_tdep): Likewise.
+ * armnbsd-tdep.c (_initialize_armnbsd_tdep): Likewise.
+ * hppa-hpux-tdep.c (_initialize_hppa_hpux_tdep): Likewise.
+ * i386-interix-tdep.c (_initialize_i386_interix_tdep): Likewise.
+ * i386-linux-tdep.c (_initialize_i386_linux_tdep): Likewise.
+ * i386-sol2-tdep.c (_initialize_i386_sol2_tdep): Likewise.
+ * i386-tdep.c (_initialize_i386_tdep): Likewise.
+ * i386bsd-tdep.c (_initialize_i386bsd_tdep): Likewise.
+ * i386gnu-tdep.c (_initialize_i386gnu_tdep): Likewise.
+ * i386ly-tdep.c (_initialize_i386lynx_tdep): Renamed from
+ _initialize_i386bsd_tdep and updated likewise.
+ * i386nbsd-tdep.c (_initialize_i386nbsd_tdep): Likewise.
+ * i386obsd-tdep.c (_initialize_i386obsd_tdep): Likewise.
+ * mips-irix-tdep.c (_initialize_mips_irix_tdep): Likewise.
+ * mips-linux-tdep.c (_initialize_mips_linux_tdep): Likewise.
+ * mipsnbsd-tdep.c (_initialize_mipsnbsd__tdep): Likewise.
+ * ns32knbsd-tdep.c (_initialize_ns32kmnsd_tdep): Likewise.
+ * ppc-linux-tdep.c (_initialize_ppc_linux_tdep): Likewise.
+ * ppcnbsd-tdep.c (_initialize_ppcnbsd_tdep): Likewise.
+ * shnbsd-tdep.c (_initialize_shnbsd_tdep): Likewise.
+ * sparcnbsd-tdep.c (_initialize_sparcnbsd_tdep): Likewise.
+
2002-12-20 Kevin Buettner <kevinb@redhat.com>
* solib-svr4.c (elf_locate_base): Fix sizeof() related bug. Add
diff --git a/gdb/alpha-linux-tdep.c b/gdb/alpha-linux-tdep.c
index 4596d37..26f4db4 100644
--- a/gdb/alpha-linux-tdep.c
+++ b/gdb/alpha-linux-tdep.c
@@ -116,6 +116,6 @@ alpha_linux_init_abi (struct gdbarch_info info,
void
_initialize_alpha_linux_tdep (void)
{
- gdbarch_register_osabi (bfd_arch_alpha, GDB_OSABI_LINUX,
+ gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_LINUX,
alpha_linux_init_abi);
}
diff --git a/gdb/alpha-osf1-tdep.c b/gdb/alpha-osf1-tdep.c
index ece5e26..c170a37 100644
--- a/gdb/alpha-osf1-tdep.c
+++ b/gdb/alpha-osf1-tdep.c
@@ -73,5 +73,6 @@ alpha_osf1_init_abi (struct gdbarch_info info,
void
_initialize_alpha_osf1_tdep (void)
{
- gdbarch_register_osabi (bfd_arch_alpha, GDB_OSABI_OSF1, alpha_osf1_init_abi);
+ gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_OSF1,
+ alpha_osf1_init_abi);
}
diff --git a/gdb/alphafbsd-tdep.c b/gdb/alphafbsd-tdep.c
index f8f515d..6af3b4d 100644
--- a/gdb/alphafbsd-tdep.c
+++ b/gdb/alphafbsd-tdep.c
@@ -78,6 +78,6 @@ alphafbsd_init_abi (struct gdbarch_info info,
void
_initialize_alphafbsd_tdep (void)
{
- gdbarch_register_osabi (bfd_arch_alpha, GDB_OSABI_FREEBSD_ELF,
+ gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_FREEBSD_ELF,
alphafbsd_init_abi);
}
diff --git a/gdb/alphanbsd-tdep.c b/gdb/alphanbsd-tdep.c
index bc7b1a4..e09b945 100644
--- a/gdb/alphanbsd-tdep.c
+++ b/gdb/alphanbsd-tdep.c
@@ -232,7 +232,7 @@ alphanbsd_init_abi (struct gdbarch_info info,
void
_initialize_alphanbsd_tdep (void)
{
- gdbarch_register_osabi (bfd_arch_alpha, GDB_OSABI_NETBSD_ELF,
+ gdbarch_register_osabi (bfd_arch_alpha, 0, GDB_OSABI_NETBSD_ELF,
alphanbsd_init_abi);
add_core_fns (&alphanbsd_core_fns);
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index cb930b6..627ed8d 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -543,5 +543,6 @@ arm_linux_init_abi (struct gdbarch_info info,
void
_initialize_arm_linux_tdep (void)
{
- gdbarch_register_osabi (bfd_arch_arm, GDB_OSABI_LINUX, arm_linux_init_abi);
+ gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_LINUX,
+ arm_linux_init_abi);
}
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 6ec7b7a..3543cc1 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -3110,11 +3110,11 @@ _initialize_arm_tdep (void)
arm_elf_osabi_sniffer);
/* Register some ABI variants for embedded systems. */
- gdbarch_register_osabi (bfd_arch_arm, GDB_OSABI_ARM_EABI_V1,
+ gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_ARM_EABI_V1,
arm_init_abi_eabi_v1);
- gdbarch_register_osabi (bfd_arch_arm, GDB_OSABI_ARM_EABI_V2,
+ gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_ARM_EABI_V2,
arm_init_abi_eabi_v2);
- gdbarch_register_osabi (bfd_arch_arm, GDB_OSABI_ARM_APCS,
+ gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_ARM_APCS,
arm_init_abi_apcs);
tm_print_insn = gdb_print_insn_arm;
diff --git a/gdb/armnbsd-tdep.c b/gdb/armnbsd-tdep.c
index 0e7ab54..80113f5 100644
--- a/gdb/armnbsd-tdep.c
+++ b/gdb/armnbsd-tdep.c
@@ -97,8 +97,8 @@ _initialize_arm_netbsd_tdep (void)
gdbarch_register_osabi_sniffer (bfd_arch_arm, bfd_target_aout_flavour,
arm_netbsd_aout_osabi_sniffer);
- gdbarch_register_osabi (bfd_arch_arm, GDB_OSABI_NETBSD_AOUT,
+ gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_NETBSD_AOUT,
arm_netbsd_aout_init_abi);
- gdbarch_register_osabi (bfd_arch_arm, GDB_OSABI_NETBSD_ELF,
+ gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_NETBSD_ELF,
arm_netbsd_elf_init_abi);
}
diff --git a/gdb/hppa-hpux-tdep.c b/gdb/hppa-hpux-tdep.c
index 371cb00..37e6ccb 100644
--- a/gdb/hppa-hpux-tdep.c
+++ b/gdb/hppa-hpux-tdep.c
@@ -38,9 +38,8 @@ hppa_hpux_elf_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
void
_initialize_hppa_hpux_tdep (void)
{
- gdbarch_register_osabi (bfd_arch_hppa, GDB_OSABI_HPUX_SOM,
+ gdbarch_register_osabi (bfd_arch_hppa, 0, GDB_OSABI_HPUX_SOM,
hppa_hpux_som_init_abi);
- gdbarch_register_osabi (bfd_arch_hppa, GDB_OSABI_HPUX_ELF,
+ gdbarch_register_osabi (bfd_arch_hppa, 0, GDB_OSABI_HPUX_ELF,
hppa_hpux_elf_init_abi);
}
-
diff --git a/gdb/i386-interix-tdep.c b/gdb/i386-interix-tdep.c
index 62bc496..f8252e2 100644
--- a/gdb/i386-interix-tdep.c
+++ b/gdb/i386-interix-tdep.c
@@ -354,6 +354,6 @@ _initialize_i386_interix_tdep (void)
gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_coff_flavour,
i386_interix_osabi_sniffer);
- gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_INTERIX,
+ gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_INTERIX,
i386_interix_init_abi);
}
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index f35c4ff..1ef14fc 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -482,6 +482,6 @@ extern void _initialize_i386_linux_tdep (void);
void
_initialize_i386_linux_tdep (void)
{
- gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_LINUX,
+ gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_LINUX,
i386_linux_init_abi);
}
diff --git a/gdb/i386-sol2-tdep.c b/gdb/i386-sol2-tdep.c
index c72a7ed..792923c 100644
--- a/gdb/i386-sol2-tdep.c
+++ b/gdb/i386-sol2-tdep.c
@@ -75,6 +75,6 @@ _initialize_i386_sol2_tdep (void)
gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour,
i386_sol2_osabi_sniffer);
- gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_SOLARIS,
+ gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_SOLARIS,
i386_sol2_init_abi);
}
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 501c15a..9d50879 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -1715,11 +1715,11 @@ are \"default\", \"pcc\" and \"reg\", and the default value is \"default\".",
gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_nlm_flavour,
i386_nlm_osabi_sniffer);
- gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_SVR4,
+ gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_SVR4,
i386_svr4_init_abi);
- gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_GO32,
+ gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_GO32,
i386_go32_init_abi);
- gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_NETWARE,
+ gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_NETWARE,
i386_nw_init_abi);
/* Initialize the i386 specific register groups. */
diff --git a/gdb/i386bsd-tdep.c b/gdb/i386bsd-tdep.c
index a760123..77a4eec 100644
--- a/gdb/i386bsd-tdep.c
+++ b/gdb/i386bsd-tdep.c
@@ -195,8 +195,8 @@ _initialize_i386bsd_tdep (void)
gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_aout_flavour,
i386bsd_aout_osabi_sniffer);
- gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_FREEBSD_AOUT,
+ gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_FREEBSD_AOUT,
i386fbsdaout_init_abi);
- gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_FREEBSD_ELF,
+ gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_FREEBSD_ELF,
i386fbsd4_init_abi);
}
diff --git a/gdb/i386gnu-tdep.c b/gdb/i386gnu-tdep.c
index fa56428..143ddc0 100644
--- a/gdb/i386gnu-tdep.c
+++ b/gdb/i386gnu-tdep.c
@@ -39,5 +39,5 @@ extern void _initialize_i386gnu_tdep (void);
void
_initialize_i386gnu_tdep (void)
{
- gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_HURD, i386gnu_init_abi);
+ gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_HURD, i386gnu_init_abi);
}
diff --git a/gdb/i386ly-tdep.c b/gdb/i386ly-tdep.c
index 69c3750..22bab3a 100644
--- a/gdb/i386ly-tdep.c
+++ b/gdb/i386ly-tdep.c
@@ -70,11 +70,11 @@ i386lynx_coff_osabi_sniffer (bfd *abfd)
void _initialize_i386lynx_tdep (void);
void
-_initialize_i386bsd_tdep (void)
+_initialize_i386lynx_tdep (void)
{
gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_coff_flavour,
i386lynx_coff_osabi_sniffer);
- gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_LYNXOS,
+ gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_LYNXOS,
i386lynx_init_abi);
}
diff --git a/gdb/i386nbsd-tdep.c b/gdb/i386nbsd-tdep.c
index 4558a35..69283f8 100644
--- a/gdb/i386nbsd-tdep.c
+++ b/gdb/i386nbsd-tdep.c
@@ -299,8 +299,8 @@ _initialize_i386nbsd_tdep (void)
add_core_fns (&i386nbsd_core_fns);
add_core_fns (&i386nbsd_elfcore_fns);
- gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_NETBSD_AOUT,
+ gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_NETBSD_AOUT,
i386nbsd_init_abi);
- gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_NETBSD_ELF,
+ gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_NETBSD_ELF,
i386nbsdelf_init_abi);
}
diff --git a/gdb/i386obsd-tdep.c b/gdb/i386obsd-tdep.c
index 7f16237..8bbce84 100644
--- a/gdb/i386obsd-tdep.c
+++ b/gdb/i386obsd-tdep.c
@@ -117,6 +117,6 @@ _initialize_i386obsd_tdep (void)
expected. */
#define GDB_OSABI_OPENBSD_AOUT GDB_OSABI_NETBSD_AOUT
- gdbarch_register_osabi (bfd_arch_i386, GDB_OSABI_OPENBSD_AOUT,
+ gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_OPENBSD_AOUT,
i386obsd_init_abi);
}
diff --git a/gdb/mips-irix-tdep.c b/gdb/mips-irix-tdep.c
index 73183ca..d5ff31e 100644
--- a/gdb/mips-irix-tdep.c
+++ b/gdb/mips-irix-tdep.c
@@ -90,6 +90,6 @@ _initialize_mips_irix_tdep (void)
bfd_target_elf_flavour,
mips_irix_elf_osabi_sniffer);
- gdbarch_register_osabi (bfd_arch_mips, GDB_OSABI_IRIX,
+ gdbarch_register_osabi (bfd_arch_mips, 0, GDB_OSABI_IRIX,
mips_irix_init_abi);
}
diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c
index 3a40670..e5aecff 100644
--- a/gdb/mips-linux-tdep.c
+++ b/gdb/mips-linux-tdep.c
@@ -358,7 +358,7 @@ mips_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
void
_initialize_mips_linux_tdep (void)
{
- gdbarch_register_osabi (bfd_arch_mips, GDB_OSABI_LINUX,
+ gdbarch_register_osabi (bfd_arch_mips, 0, GDB_OSABI_LINUX,
mips_linux_init_abi);
add_core_fns (&regset_core_fns);
}
diff --git a/gdb/mipsnbsd-tdep.c b/gdb/mipsnbsd-tdep.c
index 73ba384..7776d46 100644
--- a/gdb/mipsnbsd-tdep.c
+++ b/gdb/mipsnbsd-tdep.c
@@ -359,7 +359,7 @@ mipsnbsd_init_abi (struct gdbarch_info info,
void
_initialize_mipsnbsd_tdep (void)
{
- gdbarch_register_osabi (bfd_arch_mips, GDB_OSABI_NETBSD_ELF,
+ gdbarch_register_osabi (bfd_arch_mips, 0, GDB_OSABI_NETBSD_ELF,
mipsnbsd_init_abi);
add_core_fns (&mipsnbsd_core_fns);
diff --git a/gdb/ns32knbsd-tdep.c b/gdb/ns32knbsd-tdep.c
index d5ec828..ad360c8 100644
--- a/gdb/ns32knbsd-tdep.c
+++ b/gdb/ns32knbsd-tdep.c
@@ -66,6 +66,6 @@ _initialize_ns32knbsd_tdep (void)
gdbarch_register_osabi_sniffer (bfd_arch_ns32k, bfd_target_aout_flavour,
ns32knbsd_aout_osabi_sniffer);
- gdbarch_register_osabi (bfd_arch_ns32k, GDB_OSABI_NETBSD_AOUT,
+ gdbarch_register_osabi (bfd_arch_ns32k, 0, GDB_OSABI_NETBSD_AOUT,
ns32knbsd_init_abi_aout);
}
diff --git a/gdb/osabi.c b/gdb/osabi.c
index 06d9c90..47d08a2 100644
--- a/gdb/osabi.c
+++ b/gdb/osabi.c
@@ -19,7 +19,10 @@
Boston, MA 02111-1307, USA. */
#include "defs.h"
+
+#include "gdb_assert.h"
#include "gdb_string.h"
+
#include "osabi.h"
#include "elf-bfd.h"
@@ -70,7 +73,7 @@ gdbarch_osabi_name (enum gdb_osabi osabi)
struct gdb_osabi_handler
{
struct gdb_osabi_handler *next;
- enum bfd_architecture arch;
+ const struct bfd_arch_info *arch_info;
enum gdb_osabi osabi;
void (*init_osabi)(struct gdbarch_info, struct gdbarch *);
};
@@ -78,11 +81,13 @@ struct gdb_osabi_handler
static struct gdb_osabi_handler *gdb_osabi_handler_list;
void
-gdbarch_register_osabi (enum bfd_architecture arch, enum gdb_osabi osabi,
+gdbarch_register_osabi (enum bfd_architecture arch, unsigned long machine,
+ enum gdb_osabi osabi,
void (*init_osabi)(struct gdbarch_info,
struct gdbarch *))
{
struct gdb_osabi_handler **handler_p;
+ const struct bfd_arch_info *arch_info = bfd_lookup_arch (arch, machine);
/* Registering an OS ABI handler for "unknown" is not allowed. */
if (osabi == GDB_OSABI_UNKNOWN)
@@ -93,14 +98,16 @@ gdbarch_register_osabi (enum bfd_architecture arch, enum gdb_osabi osabi,
"OS ABI \"%s\" for architecture %s was made. The handler will "
"not be registered",
gdbarch_osabi_name (osabi),
- bfd_printable_arch_mach (arch, 0));
+ bfd_printable_arch_mach (arch, machine));
return;
}
+ gdb_assert (arch_info);
+
for (handler_p = &gdb_osabi_handler_list; *handler_p != NULL;
handler_p = &(*handler_p)->next)
{
- if ((*handler_p)->arch == arch
+ if ((*handler_p)->arch_info == arch_info
&& (*handler_p)->osabi == osabi)
{
internal_error
@@ -108,7 +115,7 @@ gdbarch_register_osabi (enum bfd_architecture arch, enum gdb_osabi osabi,
"gdbarch_register_osabi: A handler for OS ABI \"%s\" "
"has already been registered for architecture %s",
gdbarch_osabi_name (osabi),
- bfd_printable_arch_mach (arch, 0));
+ arch_info->printable_name);
/* If user wants to continue, override previous definition. */
(*handler_p)->init_osabi = init_osabi;
return;
@@ -118,7 +125,7 @@ gdbarch_register_osabi (enum bfd_architecture arch, enum gdb_osabi osabi,
(*handler_p)
= (struct gdb_osabi_handler *) xmalloc (sizeof (struct gdb_osabi_handler));
(*handler_p)->next = NULL;
- (*handler_p)->arch = arch;
+ (*handler_p)->arch_info = arch_info;
(*handler_p)->osabi = osabi;
(*handler_p)->init_osabi = init_osabi;
}
@@ -230,9 +237,9 @@ void
gdbarch_init_osabi (struct gdbarch_info info, struct gdbarch *gdbarch,
enum gdb_osabi osabi)
{
- struct gdb_osabi_handler *handler;
- bfd *abfd = info.abfd;
const struct bfd_arch_info *arch_info = gdbarch_bfd_arch_info (gdbarch);
+ const struct bfd_arch_info *compatible;
+ struct gdb_osabi_handler *handler;
if (osabi == GDB_OSABI_UNKNOWN)
{
@@ -244,8 +251,19 @@ gdbarch_init_osabi (struct gdbarch_info info, struct gdbarch *gdbarch,
for (handler = gdb_osabi_handler_list; handler != NULL;
handler = handler->next)
{
- if (handler->arch == bfd_get_arch (abfd)
- && handler->osabi == osabi)
+ if (handler->osabi != osabi)
+ continue;
+
+ /* Check whether the machine type and architecture of the
+ handler are compatible with the desired machine type and
+ architecture.
+
+ NOTE: kettenis/20021027: There may be more than one machine
+ type that is compatible with the desired machine type. Right
+ now we simply return the first match, which is fine for now.
+ However, we might want to do something smarter in the future. */
+ compatible = arch_info->compatible (arch_info, handler->arch_info);
+ if (compatible == handler->arch_info)
{
(*handler->init_osabi) (info, gdbarch);
return;
diff --git a/gdb/osabi.h b/gdb/osabi.h
index ad2bea1..ebff831 100644
--- a/gdb/osabi.h
+++ b/gdb/osabi.h
@@ -61,9 +61,11 @@ void gdbarch_register_osabi_sniffer (enum bfd_architecture,
enum bfd_flavour,
enum gdb_osabi (*)(bfd *));
-/* Register a handler for an OS ABI variant for a given architecture. There
- should be only one handler for a given OS ABI each architecture family. */
-void gdbarch_register_osabi (enum bfd_architecture, enum gdb_osabi,
+/* Register a handler for an OS ABI variant for a given architecture
+ and machine type. There should be only one handler for a given OS
+ ABI for each architecture and machine type combination. */
+void gdbarch_register_osabi (enum bfd_architecture, unsigned long,
+ enum gdb_osabi,
void (*)(struct gdbarch_info,
struct gdbarch *));
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index de68702..0f6699e 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -726,7 +726,7 @@ ppc_linux_init_abi (struct gdbarch_info info,
void
_initialize_ppc_linux_tdep (void)
{
- gdbarch_register_osabi (bfd_arch_powerpc, GDB_OSABI_LINUX,
+ gdbarch_register_osabi (bfd_arch_powerpc, 0, GDB_OSABI_LINUX,
ppc_linux_init_abi);
add_core_fns (&ppc_linux_regset_core_fns);
}
diff --git a/gdb/ppcnbsd-tdep.c b/gdb/ppcnbsd-tdep.c
index 3d052a8..e58bb6a 100644
--- a/gdb/ppcnbsd-tdep.c
+++ b/gdb/ppcnbsd-tdep.c
@@ -219,7 +219,7 @@ ppcnbsd_init_abi (struct gdbarch_info info,
void
_initialize_ppcnbsd_tdep (void)
{
- gdbarch_register_osabi (bfd_arch_powerpc, GDB_OSABI_NETBSD_ELF,
+ gdbarch_register_osabi (bfd_arch_powerpc, 0, GDB_OSABI_NETBSD_ELF,
ppcnbsd_init_abi);
add_core_fns (&ppcnbsd_core_fns);
diff --git a/gdb/shnbsd-tdep.c b/gdb/shnbsd-tdep.c
index b67884d..d2f042a 100644
--- a/gdb/shnbsd-tdep.c
+++ b/gdb/shnbsd-tdep.c
@@ -188,5 +188,6 @@ _initialize_shnbsd_tdep (void)
add_core_fns (&shnbsd_core_fns);
add_core_fns (&shnbsd_elfcore_fns);
- gdbarch_register_osabi (bfd_arch_sh, GDB_OSABI_NETBSD_ELF, shnbsd_init_abi);
+ gdbarch_register_osabi (bfd_arch_sh, 0, GDB_OSABI_NETBSD_ELF,
+ shnbsd_init_abi);
}
diff --git a/gdb/sparcnbsd-tdep.c b/gdb/sparcnbsd-tdep.c
index 1103eaa..ab984ff 100644
--- a/gdb/sparcnbsd-tdep.c
+++ b/gdb/sparcnbsd-tdep.c
@@ -523,9 +523,9 @@ _initialize_sparnbsd_tdep (void)
gdbarch_register_osabi_sniffer (bfd_arch_sparc, bfd_target_aout_flavour,
sparcnbsd_aout_osabi_sniffer);
- gdbarch_register_osabi (bfd_arch_sparc, GDB_OSABI_NETBSD_AOUT,
+ gdbarch_register_osabi (bfd_arch_sparc, 0, GDB_OSABI_NETBSD_AOUT,
sparcnbsd_init_abi_aout);
- gdbarch_register_osabi (bfd_arch_sparc, GDB_OSABI_NETBSD_ELF,
+ gdbarch_register_osabi (bfd_arch_sparc, 0, GDB_OSABI_NETBSD_ELF,
sparcnbsd_init_abi_elf);
add_core_fns (&sparcnbsd_core_fns);