Change return type of gdbarch_software_single_step to vector<CORE_ADDR>
[deliverable/binutils-gdb.git] / gdb / s390-linux-tdep.c
index 55129d81f4c5cb0dc634ff83b8ba6a8a92209b00..8139d817d94152a2b2e4cdd6992b88a8d3d06f49 100644 (file)
@@ -725,7 +725,7 @@ s390_is_partial_instruction (struct gdbarch *gdbarch, CORE_ADDR loc, int *len)
    process about 4kiB of it each time, leading to O(n**2) memory and time
    complexity.  */
 
-static VEC (CORE_ADDR) *
+static std::vector<CORE_ADDR>
 s390_software_single_step (struct regcache *regcache)
 {
   struct gdbarch *gdbarch = get_regcache_arch (regcache);
@@ -733,33 +733,30 @@ s390_software_single_step (struct regcache *regcache)
   enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
   int len;
   uint16_t insn;
-  VEC (CORE_ADDR) *next_pcs = NULL;
 
   /* Special handling only if recording.  */
   if (!record_full_is_used ())
-    return NULL;
+    return {};
 
   /* First, match a partial instruction.  */
   if (!s390_is_partial_instruction (gdbarch, loc, &len))
-    return NULL;
+    return {};
 
   loc += len;
 
   /* Second, look for a branch back to it.  */
   insn = read_memory_integer (loc, 2, byte_order);
   if (insn != 0xa714) /* BRC with mask 1 */
-    return NULL;
+    return {};
 
   insn = read_memory_integer (loc + 2, 2, byte_order);
   if (insn != (uint16_t) -(len / 2))
-    return NULL;
+    return {};
 
   loc += 4;
 
   /* Found it, step past the whole thing.  */
-  VEC_safe_push (CORE_ADDR, next_pcs, loc);
-
-  return next_pcs;
+  return {loc};
 }
 
 static int
This page took 0.024651 seconds and 4 git commands to generate.