[committed] MIPS: Respect the "set mips compression" command

Message ID alpine.DEB.1.10.1407251906360.16254@tp.orcam.me.uk
State Committed
Headers

Commit Message

Maciej W. Rozycki July 25, 2014, 6:09 p.m. UTC
  Hi,

 This fixes gdbarch matching, making sure one for the opposite compressed
ISA variation is not chosen.  That in turn makes "set mips compression"
work; right now the setting sticks to the initial value, either inferred
from the ELF header of the binary first loaded or the default value if
no binary has been used.  This only affects debugging with no symbol
table available or no binary chosen at all, as otherwise symbol
annotations determine the compressed ISA variation.

 Committed.

2014-07-25  Maciej W. Rozycki  <macro@codesourcery.com>

	gdb/
	* mips-tdep.c (mips_gdbarch_init): Also check the compressed ISA
	variation in gdbarch matching.

  Maciej

gdb-mips-tdep-isa.diff
  

Patch

Index: gdb-2014.05/gdb/mips-tdep.c
===================================================================
--- gdb-2014.05.orig/gdb/mips-tdep.c	2014-07-18 11:02:44.000000000 +0100
+++ gdb-2014.05/gdb/mips-tdep.c	2014-07-19 00:30:44.384830855 +0100
@@ -9172,12 +9172,14 @@  mips_gdbarch_init (struct gdbarch_info i
        arches != NULL;
        arches = gdbarch_list_lookup_by_info (arches->next, &info))
     {
-      /* MIPS needs to be pedantic about which ABI the object is
-         using.  */
+      /* MIPS needs to be pedantic about which ABI and the compressed
+         ISA variation the object is using.  */
       if (gdbarch_tdep (arches->gdbarch)->elf_flags != elf_flags)
 	continue;
       if (gdbarch_tdep (arches->gdbarch)->mips_abi != mips_abi)
 	continue;
+      if (gdbarch_tdep (arches->gdbarch)->mips_isa != mips_isa)
+	continue;
       /* Need to be pedantic about which register virtual size is
          used.  */
       if (gdbarch_tdep (arches->gdbarch)->mips64_transfers_32bit_regs_p