Replace some $ARCH_{get,set}_pc with linux_{get,set}_pc_64bit
[deliverable/binutils-gdb.git] / gdb / mips-tdep.c
index 7cea8321a4f1487c1aa8d7d9dacfee44d35ca836..ca17864f68b5fa6be3dbcf57016d35af215939f8 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for the MIPS architecture, for GDB, the GNU Debugger.
 
-   Copyright (C) 1988-2015 Free Software Foundation, Inc.
+   Copyright (C) 1988-2016 Free Software Foundation, Inc.
 
    Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU
    and by Per Bothner(bothner@cs.wisc.edu) at U.Wisconsin.
@@ -1429,12 +1429,12 @@ mips_write_pc (struct regcache *regcache, CORE_ADDR pc)
 
 static ULONGEST
 mips_fetch_instruction (struct gdbarch *gdbarch,
-                       enum mips_isa isa, CORE_ADDR addr, int *statusp)
+                       enum mips_isa isa, CORE_ADDR addr, int *errp)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   gdb_byte buf[MIPS_INSN32_SIZE];
   int instlen;
-  int status;
+  int err;
 
   switch (isa)
     {
@@ -1450,13 +1450,13 @@ mips_fetch_instruction (struct gdbarch *gdbarch,
       internal_error (__FILE__, __LINE__, _("invalid ISA"));
       break;
     }
-  status = target_read_memory (addr, buf, instlen);
-  if (statusp != NULL)
-    *statusp = status;
-  if (status)
+  err = target_read_memory (addr, buf, instlen);
+  if (errp != NULL)
+    *errp = err;
+  if (err != 0)
     {
-      if (statusp == NULL)
-       memory_error (status, addr);
+      if (errp == NULL)
+       memory_error (TARGET_XFER_E_IO, addr);
       return 0;
     }
   return extract_unsigned_integer (buf, instlen, byte_order);
@@ -7118,12 +7118,13 @@ mips_breakpoint_from_pc (struct gdbarch *gdbarch,
          static gdb_byte micromips16_big_breakpoint[] = { 0x46, 0x85 };
          static gdb_byte micromips32_big_breakpoint[] = { 0, 0x5, 0, 0x7 };
          ULONGEST insn;
-         int status;
+         int err;
          int size;
 
-         insn = mips_fetch_instruction (gdbarch, ISA_MICROMIPS, pc, &status);
-         size = status ? 2
-                       : mips_insn_size (ISA_MICROMIPS, insn) == 2 ? 2 : 4;
+         insn = mips_fetch_instruction (gdbarch, ISA_MICROMIPS, pc, &err);
+         size = (err != 0
+                 ? 2 : (mips_insn_size (ISA_MICROMIPS, insn) == 2
+                        ? 2 : 4));
          *pcptr = unmake_compact_addr (pc);
          *lenptr = size;
          return (size == 2) ? micromips16_big_breakpoint
@@ -7169,12 +7170,13 @@ mips_breakpoint_from_pc (struct gdbarch *gdbarch,
          static gdb_byte micromips16_little_breakpoint[] = { 0x85, 0x46 };
          static gdb_byte micromips32_little_breakpoint[] = { 0x5, 0, 0x7, 0 };
          ULONGEST insn;
-         int status;
+         int err;
          int size;
 
-         insn = mips_fetch_instruction (gdbarch, ISA_MICROMIPS, pc, &status);
-         size = status ? 2
-                       : mips_insn_size (ISA_MICROMIPS, insn) == 2 ? 2 : 4;
+         insn = mips_fetch_instruction (gdbarch, ISA_MICROMIPS, pc, &err);
+         size = (err != 0
+                 ? 2 : (mips_insn_size (ISA_MICROMIPS, insn) == 2
+                        ? 2 : 4));
          *pcptr = unmake_compact_addr (pc);
          *lenptr = size;
          return (size == 2) ? micromips16_little_breakpoint
This page took 0.026869 seconds and 4 git commands to generate.