This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Abi selection based on set arch command in case of remote debugging for MIPS


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)


-- 
Sincerely, Denis Dmitriev.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]