2007-09-12 H.J. Lu <hongjiu.lu@intel.com>
[deliverable/binutils-gdb.git] / gdb / sparcnbsd-tdep.c
index 0b8d86ef85dd53a272ec7fff46e7dac626cbaed9..f330748633cae9f1d84729d885ba624960f6e690 100644 (file)
@@ -7,7 +7,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "floatformat.h"
 #include "frame.h"
 #include "frame-unwind.h"
 #include "gdbcore.h"
+#include "gdbtypes.h"
 #include "osabi.h"
 #include "regcache.h"
 #include "regset.h"
@@ -265,21 +263,18 @@ sparc32nbsd_sigtramp_frame_sniffer (struct frame_info *next_frame)
    address.  */
 
 CORE_ADDR
-sparcnbsd_step_trap (unsigned long insn)
+sparcnbsd_step_trap (struct frame_info *frame, unsigned long insn)
 {
   if ((X_I (insn) == 0 && X_RS1 (insn) == 0 && X_RS2 (insn) == 0)
       || (X_I (insn) == 1 && X_RS1 (insn) == 0 && (insn & 0x7f) == 0))
     {
       /* "New" system call.  */
-      ULONGEST number;
-
-      regcache_cooked_read_unsigned (current_regcache,
-                                    SPARC_G1_REGNUM, &number);
+      ULONGEST number = get_frame_register_unsigned (frame, SPARC_G1_REGNUM);
 
       if (number & 0x400)
-       return sparc_address_from_register (SPARC_G2_REGNUM);
+       return get_frame_register_unsigned (frame, SPARC_G2_REGNUM);
       if (number & 0x800)
-       return sparc_address_from_register (SPARC_G7_REGNUM);
+       return get_frame_register_unsigned (frame, SPARC_G7_REGNUM);
     }
 
   return 0;
This page took 0.024826 seconds and 4 git commands to generate.