Implement pahole-like 'ptype /o' option
[deliverable/binutils-gdb.git] / gdb / alpha-tdep.c
index 4331422648b80462ba4de73aa0b03165135120f0..07144ceb4e76763e697df37ca737f3d4b5b6a801 100644 (file)
@@ -767,10 +767,8 @@ static const int stq_c_opcode = 0x2f;
    the sequence.  */
 
 static std::vector<CORE_ADDR>
-alpha_deal_with_atomic_sequence (struct regcache *regcache)
+alpha_deal_with_atomic_sequence (struct gdbarch *gdbarch, CORE_ADDR pc)
 {
-  struct gdbarch *gdbarch = regcache->arch ();
-  CORE_ADDR pc = regcache_read_pc (regcache);
   CORE_ADDR breaks[2] = {-1, -1};
   CORE_ADDR loc = pc;
   CORE_ADDR closing_insn; /* Instruction that closes the atomic sequence.  */
@@ -1461,7 +1459,8 @@ static const struct frame_base alpha_heuristic_frame_base = {
    callable as an sfunc.  Used by the "set heuristic-fence-post" command.  */
 
 static void
-reinit_frame_cache_sfunc (char *args, int from_tty, struct cmd_list_element *c)
+reinit_frame_cache_sfunc (const char *args,
+                         int from_tty, struct cmd_list_element *c)
 {
   reinit_frame_cache ();
 }
@@ -1723,11 +1722,16 @@ std::vector<CORE_ADDR>
 alpha_software_single_step (struct regcache *regcache)
 {
   struct gdbarch *gdbarch = regcache->arch ();
-  CORE_ADDR pc;
 
-  pc = alpha_next_pc (regcache, regcache_read_pc (regcache));
+  CORE_ADDR pc = regcache_read_pc (regcache);
+
+  std::vector<CORE_ADDR> next_pcs
+    = alpha_deal_with_atomic_sequence (gdbarch, pc);
+  if (!next_pcs.empty ())
+    return next_pcs;
 
-  return {pc};
+  CORE_ADDR next_pc = alpha_next_pc (regcache, pc);
+  return {next_pc};
 }
 
 \f
@@ -1823,7 +1827,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_cannot_step_breakpoint (gdbarch, 1);
 
   /* Handles single stepping of atomic sequences.  */
-  set_gdbarch_software_single_step (gdbarch, alpha_deal_with_atomic_sequence);
+  set_gdbarch_software_single_step (gdbarch, alpha_software_single_step);
 
   /* Hook in ABI-specific overrides, if they have been registered.  */
   gdbarch_init_osabi (info, gdbarch);
This page took 0.024543 seconds and 4 git commands to generate.