public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [patch, nios2] fix _initialize_nios2_linux_tdep for BFD mach changes
@ 2015-07-02  1:21 Sandra Loosemore
  0 siblings, 0 replies; only message in thread
From: Sandra Loosemore @ 2015-07-02  1:21 UTC (permalink / raw)
  To: gdb-patches, Yao Qi

[-- Attachment #1: Type: text/plain, Size: 872 bytes --]

As a consequence of this patch

https://sourceware.org/ml/binutils/2015-07/msg00015.html

which introduced new BFD mach identifiers for Nios II R1 and R2 
processor variants, BFD now identifies Nios II R1 objects as 
bfd_mach_nios2r1 instead of bfd_mach_nios2.  This breaks
the call to gdbarch_register_osabi, such that GDB fails to recognize R1 
nios2-linux-gnu executables.  Note that this is *not* due to any 
incompatible change in R1 ELF objects, just in BFD's internal 
representation of the mach values.

I stole this fix verbatim from the MIPS back end so I consider it 
borderline obvious.  I don't like to leave GDB in a broken state so I 
propose to commit this in a few days unless I hear objections meanwhile.

The patches to add GDB support for Nios II R2 objects will be coming 
along later; this patch just un-breaks the existing support for R1.

-Sandra


[-- Attachment #2: gdb-osabi.log --]
[-- Type: text/x-log, Size: 152 bytes --]

2015-07-01  Sandra Loosemore  <sandra@codesourcery.com>

	gdb/
	* nios2-linux-tdep.c (_initialize_nios2_linux_tdep): Register
	all nios2 mach variants.

[-- Attachment #3: gdb-osabi.patch --]
[-- Type: text/x-patch, Size: 706 bytes --]

diff --git a/gdb/nios2-linux-tdep.c b/gdb/nios2-linux-tdep.c
index 0a837b0..68c949a 100644
--- a/gdb/nios2-linux-tdep.c
+++ b/gdb/nios2-linux-tdep.c
@@ -223,8 +223,14 @@ extern initialize_file_ftype _initialize_nios2_linux_tdep;
 void
 _initialize_nios2_linux_tdep (void)
 {
-  gdbarch_register_osabi (bfd_arch_nios2, 0, GDB_OSABI_LINUX,
-                          nios2_linux_init_abi);
+
+  const struct bfd_arch_info *arch_info;
+
+  for (arch_info = bfd_lookup_arch (bfd_arch_nios2, 0);
+       arch_info != NULL;
+       arch_info = arch_info->next)
+    gdbarch_register_osabi (bfd_arch_nios2, arch_info->mach,
+			    GDB_OSABI_LINUX, nios2_linux_init_abi);
 
   initialize_tdesc_nios2_linux ();
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-07-02  1:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-02  1:21 [patch, nios2] fix _initialize_nios2_linux_tdep for BFD mach changes Sandra Loosemore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).