Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC] sh-tdep.c: Don't fetch FPSCR register if it doesn't exist
@ 2012-03-01  0:34 Kevin Buettner
  2012-03-01  1:33 ` Joel Brobecker
  0 siblings, 1 reply; 10+ messages in thread
From: Kevin Buettner @ 2012-03-01  0:34 UTC (permalink / raw)
  To: gdb-patches; +Cc: Thomas Schwinge

The patch below fixes 119 failures for the default sh-elf multilib (using
sh-sim.)  I can post a list if there's interest in seeing them.

Comments?  Is there a better way to test for the existence of a register?

Kevin

	* sh-tdep.c (sh_frame_cache): Don't fetch the FPSCR register
	unless it exists for this architecture.

Index: sh-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sh-tdep.c,v
retrieving revision 1.239
diff -u -p -r1.239 sh-tdep.c
--- sh-tdep.c	27 Feb 2012 16:40:48 -0000	1.239
+++ sh-tdep.c	1 Mar 2012 00:31:31 -0000
@@ -2553,7 +2553,12 @@ sh_frame_cache (struct frame_info *this_
   if (cache->pc != 0)
     {
       ULONGEST fpscr;
-      fpscr = get_frame_register_unsigned (this_frame, FPSCR_REGNUM);
+      const char *fpscr_name = gdbarch_register_name (gdbarch, FPSCR_REGNUM);
+
+      if (fpscr_name && fpscr_name[0])
+	fpscr = get_frame_register_unsigned (this_frame, FPSCR_REGNUM);
+      else
+	fpscr = 0;
       sh_analyze_prologue (gdbarch, cache->pc, current_pc, cache, fpscr);
     }
 


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-03-03  1:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-01  0:34 [RFC] sh-tdep.c: Don't fetch FPSCR register if it doesn't exist Kevin Buettner
2012-03-01  1:33 ` Joel Brobecker
2012-03-01  5:09   ` Kevin Buettner
2012-03-01 10:30     ` Thomas Schwinge
2012-03-01 19:11       ` Kevin Buettner
2012-03-02  9:24         ` Thomas Schwinge
2012-03-02 13:46           ` Kevin Buettner
2012-03-03  1:29         ` Kevin Buettner
2012-03-01 15:57     ` Joel Brobecker
2012-03-01 19:10       ` Kevin Buettner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox