Denis Dmitriev
2018-10-29 08:18:33 UTC
Abi selection based on the execution of the "set arch" command in the case
of remote debugging. Mips. No need to manually configure abi.
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 5e0a606..dc6b6181 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -8085,7 +8085,20 @@ mips_gdbarch_init (struct gdbarch_info info, struct
gdbarch_list *arches)
if (info.abfd && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour)
elf_flags = elf_elfheader (info.abfd)->e_flags;
else if (arches != NULL)
+ {
elf_flags = gdbarch_tdep (arches->gdbarch)->elf_flags;
+ if (elf_flags == 0)
+ {
+ if (info.bfd_arch_info && info.bfd_arch_info->bits_per_address == 64)
+ {
+ elf_flags = E_MIPS_ABI_EABI64;
+ }
+ else if (info.bfd_arch_info->bits_per_address == 32)
+ {
+ elf_flags = MIPS_ABI_EABI32;
+ }
+ }
+ }
else
elf_flags = 0;
if (gdbarch_debug)
of remote debugging. Mips. No need to manually configure abi.
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 5e0a606..dc6b6181 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -8085,7 +8085,20 @@ mips_gdbarch_init (struct gdbarch_info info, struct
gdbarch_list *arches)
if (info.abfd && bfd_get_flavour (info.abfd) == bfd_target_elf_flavour)
elf_flags = elf_elfheader (info.abfd)->e_flags;
else if (arches != NULL)
+ {
elf_flags = gdbarch_tdep (arches->gdbarch)->elf_flags;
+ if (elf_flags == 0)
+ {
+ if (info.bfd_arch_info && info.bfd_arch_info->bits_per_address == 64)
+ {
+ elf_flags = E_MIPS_ABI_EABI64;
+ }
+ else if (info.bfd_arch_info->bits_per_address == 32)
+ {
+ elf_flags = MIPS_ABI_EABI32;
+ }
+ }
+ }
else
elf_flags = 0;
if (gdbarch_debug)
--
Sincerely, Denis Dmitriev.
Sincerely, Denis Dmitriev.