aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2009-09-29 00:53:04 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2009-09-29 00:53:04 +0000
commit99e40580307d91e399af1c0293a6676b10efefea (patch)
tree3c951a5f939f575645b767865063ddbc6ddfd0b3 /gdb/infrun.c
parent69368a60a4878ec4ef1060732020e9eaf19b32b0 (diff)
downloadgdb-99e40580307d91e399af1c0293a6676b10efefea.zip
gdb-99e40580307d91e399af1c0293a6676b10efefea.tar.gz
gdb-99e40580307d91e399af1c0293a6676b10efefea.tar.bz2
* gdbarch.sh (displaced_step_hw_singlestep): New callback.
* gdbarch.c, gdbarch.h: Regenerate. * arch-utils.c (default_displaced_step_hw_singlestep): New function. * arch-utils.h (default_displaced_step_hw_singlestep): Add prototype. * ppc-linux-tdep.c (ppc_displaced_step_hw_singlestep): New function. (rs6000_gdbarch_init): Install it. * infrun.c (displaced_step_fixup): Use new callback to determine whether to "step" or "continue" displaced copy. (resume): Likewise. Do not call maybe_software_singlestep for displaced stepping. (maybe_software_singlestep): Do not handle displaced stepping.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 1a83a25..ff7c6b9 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1002,10 +1002,11 @@ displaced_step_fixup (ptid_t event_ptid, enum target_signal signal)
displaced_step_dump_bytes (gdb_stdlog, buf, sizeof (buf));
}
- if (gdbarch_software_single_step_p (gdbarch))
- target_resume (ptid, 0, TARGET_SIGNAL_0);
- else
+ if (gdbarch_displaced_step_hw_singlestep
+ (gdbarch, displaced_step_closure))
target_resume (ptid, 1, TARGET_SIGNAL_0);
+ else
+ target_resume (ptid, 0, TARGET_SIGNAL_0);
/* Done, we're stepping a thread. */
break;
@@ -1114,19 +1115,15 @@ maybe_software_singlestep (struct gdbarch *gdbarch, CORE_ADDR pc)
{
int hw_step = 1;
- if (gdbarch_software_single_step_p (gdbarch))
+ if (gdbarch_software_single_step_p (gdbarch)
+ && gdbarch_software_single_step (gdbarch, get_current_frame ()))
{
- if (use_displaced_stepping (gdbarch))
- hw_step = 0;
- else if (gdbarch_software_single_step (gdbarch, get_current_frame ()))
- {
- hw_step = 0;
- /* Do not pull these breakpoints until after a `wait' in
- `wait_for_inferior' */
- singlestep_breakpoints_inserted_p = 1;
- singlestep_ptid = inferior_ptid;
- singlestep_pc = pc;
- }
+ hw_step = 0;
+ /* Do not pull these breakpoints until after a `wait' in
+ `wait_for_inferior' */
+ singlestep_breakpoints_inserted_p = 1;
+ singlestep_ptid = inferior_ptid;
+ singlestep_pc = pc;
}
return hw_step;
}
@@ -1208,10 +1205,13 @@ a command like `return' or `jump' to continue execution."));
discard_cleanups (old_cleanups);
return;
}
+
+ step = gdbarch_displaced_step_hw_singlestep
+ (gdbarch, displaced_step_closure);
}
/* Do we need to do it the hard way, w/temp breakpoints? */
- if (step)
+ else if (step)
step = maybe_software_singlestep (gdbarch, pc);
if (should_resume)