This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] Disable displaced stepping on AIX


Hello,

this patch fixes a regression on AIX introduced by displaced stepping.
The problem is that AIX only supports software single-step, and the
displaced stepping core infrastructure does not handle this.

Therefore, I'm simply disabling displaced stepping on AIX for now.

Tested on powerpc-ibm-aix5.3.0.0 and powerpc-linux.

Committed to mainline.

Bye,
Ulrich


ChangeLog:

	* rs6000-tdep.c (rs6000_gdbarch_init): Setup displaced stepping
	*before* calling gdbarch_init_osabi.
	(rs6000_aix_init_osabi): Disable displaced stepping.


Index: src/gdb/rs6000-aix-tdep.c
===================================================================
--- src.orig/gdb/rs6000-aix-tdep.c
+++ src/gdb/rs6000-aix-tdep.c
@@ -714,6 +714,13 @@ rs6000_aix_init_osabi (struct gdbarch_in
   /* RS6000/AIX does not support PT_STEP.  Has to be simulated.  */
   set_gdbarch_software_single_step (gdbarch, rs6000_software_single_step);
 
+  /* Displaced stepping is currently not supported in combination with
+     software single-stepping.  */
+  set_gdbarch_displaced_step_copy_insn (gdbarch, NULL);
+  set_gdbarch_displaced_step_fixup (gdbarch, NULL);
+  set_gdbarch_displaced_step_free_closure (gdbarch, NULL);
+  set_gdbarch_displaced_step_location (gdbarch, NULL);
+
   set_gdbarch_push_dummy_call (gdbarch, rs6000_push_dummy_call);
   set_gdbarch_return_value (gdbarch, rs6000_return_value);
   set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
Index: src/gdb/rs6000-tdep.c
===================================================================
--- src.orig/gdb/rs6000-tdep.c
+++ src/gdb/rs6000-tdep.c
@@ -3669,6 +3669,17 @@ rs6000_gdbarch_init (struct gdbarch_info
   /* Frame handling.  */
   dwarf2_frame_set_init_reg (gdbarch, ppc_dwarf2_frame_init_reg);
 
+  /* Setup displaced stepping.  */
+  set_gdbarch_displaced_step_copy_insn (gdbarch,
+					simple_displaced_step_copy_insn);
+  set_gdbarch_displaced_step_fixup (gdbarch, ppc_displaced_step_fixup);
+  set_gdbarch_displaced_step_free_closure (gdbarch,
+					   simple_displaced_step_free_closure);
+  set_gdbarch_displaced_step_location (gdbarch,
+				       displaced_step_at_entry_point);
+
+  set_gdbarch_max_insn_length (gdbarch, PPC_INSN_SIZE);
+
   /* Hook in ABI-specific overrides, if they have been registered.  */
   info.target_desc = tdesc;
   info.tdep_info = (void *) tdesc_data;
@@ -3732,17 +3743,6 @@ rs6000_gdbarch_init (struct gdbarch_info
   gdb_assert (gdbarch_num_regs (gdbarch)
 	      + gdbarch_num_pseudo_regs (gdbarch) == cur_reg);
 
-  /* Setup displaced stepping.  */
-  set_gdbarch_displaced_step_copy_insn (gdbarch,
-					simple_displaced_step_copy_insn);
-  set_gdbarch_displaced_step_fixup (gdbarch, ppc_displaced_step_fixup);
-  set_gdbarch_displaced_step_free_closure (gdbarch,
-					   simple_displaced_step_free_closure);
-  set_gdbarch_displaced_step_location (gdbarch,
-				       displaced_step_at_entry_point);
-
-  set_gdbarch_max_insn_length (gdbarch, PPC_INSN_SIZE);
-
   return gdbarch;
 }
 

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]