gdb: include gdbsupport/buildargv.h in ser-mingw.c
[binutils-gdb.git] / gdb / frv-tdep.c
index c74ea68fe847483edb211b347f98b12cb5fb0fe4..1f291d9117d3ddba2f4cfb9c9ad569438afd8e95 100644 (file)
@@ -1,6 +1,6 @@
 /* Target-dependent code for the Fujitsu FR-V, for GDB, the GNU Debugger.
 
-   Copyright (C) 2002-2021 Free Software Foundation, Inc.
+   Copyright (C) 2002-2022 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -38,6 +38,7 @@
 #include "solib.h"
 #include "frv-tdep.h"
 #include "objfiles.h"
+#include "gdbarch.h"
 
 struct frv_unwind_cache                /* was struct frame_extra_info */
   {
@@ -182,11 +183,8 @@ new_variant (void)
      in the G packet.  If we need more in the future, we'll add them
      elsewhere.  */
   for (r = acc0_regnum; r <= acc7_regnum; r++)
-    {
-      char *buf;
-      buf = xstrprintf ("acc%d", r - acc0_regnum);
-      var->register_names[r] = buf;
-    }
+    var->register_names[r]
+      = xstrprintf ("acc%d", r - acc0_regnum).release ();
 
   /* accg0 - accg7: These are one byte registers.  The remote protocol
      provides the raw values packed four into a slot.  accg0123 and
@@ -195,11 +193,8 @@ new_variant (void)
      likely not want to see these raw values.  */
 
   for (r = accg0_regnum; r <= accg7_regnum; r++)
-    {
-      char *buf;
-      buf = xstrprintf ("accg%d", r - accg0_regnum);
-      var->register_names[r] = buf;
-    }
+    var->register_names[r]
+      = xstrprintf ("accg%d", r - accg0_regnum).release ();
 
   /* msr0 and msr1.  */
 
@@ -601,7 +596,7 @@ frv_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc,
 
       if (target_read_memory (pc, buf, sizeof buf) != 0)
        break;
-      op = extract_signed_integer (buf, sizeof buf, byte_order);
+      op = extract_signed_integer (buf, byte_order);
 
       next_pc = pc + 4;