* infrun.c (displaced_step_fixup): If this is a software
single-stepping arch, don't tell the target to single-step. (maybe_software_singlestep): Return 0 if we're using displaced stepping. (resume): If this is a software single-stepping arch, and displaced-stepping is enabled, use it for all single-step requests.
This commit is contained in:
parent
96e946ca9a
commit
929dfd4f59
2 changed files with 33 additions and 11 deletions
|
@ -1,3 +1,14 @@
|
||||||
|
2009-07-31 Pedro Alves <pedro@codesourcery.com>
|
||||||
|
Julian Brown <julian@codesourcery.com>
|
||||||
|
|
||||||
|
* infrun.c (displaced_step_fixup): If this is a software
|
||||||
|
single-stepping arch, don't tell the target to single-step.
|
||||||
|
(maybe_software_singlestep): Return 0 if we're using displaced
|
||||||
|
stepping.
|
||||||
|
(resume): If this is a software single-stepping arch, and
|
||||||
|
displaced-stepping is enabled, use it for all single-step
|
||||||
|
requests.
|
||||||
|
|
||||||
2009-07-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
|
2009-07-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
|
||||||
|
|
||||||
* Makefile.in (ACLOCAL, ACLOCAL_AMFLAGS, aclocal_m4_deps)
|
* Makefile.in (ACLOCAL, ACLOCAL_AMFLAGS, aclocal_m4_deps)
|
||||||
|
|
33
gdb/infrun.c
33
gdb/infrun.c
|
@ -964,6 +964,7 @@ displaced_step_fixup (ptid_t event_ptid, enum target_signal signal)
|
||||||
struct displaced_step_request *head;
|
struct displaced_step_request *head;
|
||||||
ptid_t ptid;
|
ptid_t ptid;
|
||||||
struct regcache *regcache;
|
struct regcache *regcache;
|
||||||
|
struct gdbarch *gdbarch;
|
||||||
CORE_ADDR actual_pc;
|
CORE_ADDR actual_pc;
|
||||||
|
|
||||||
head = displaced_step_request_queue;
|
head = displaced_step_request_queue;
|
||||||
|
@ -985,9 +986,11 @@ displaced_step_fixup (ptid_t event_ptid, enum target_signal signal)
|
||||||
|
|
||||||
displaced_step_prepare (ptid);
|
displaced_step_prepare (ptid);
|
||||||
|
|
||||||
|
gdbarch = get_regcache_arch (regcache);
|
||||||
|
|
||||||
if (debug_displaced)
|
if (debug_displaced)
|
||||||
{
|
{
|
||||||
struct gdbarch *gdbarch = get_regcache_arch (regcache);
|
CORE_ADDR actual_pc = regcache_read_pc (regcache);
|
||||||
gdb_byte buf[4];
|
gdb_byte buf[4];
|
||||||
|
|
||||||
fprintf_unfiltered (gdb_stdlog, "displaced: run %s: ",
|
fprintf_unfiltered (gdb_stdlog, "displaced: run %s: ",
|
||||||
|
@ -996,7 +999,10 @@ displaced_step_fixup (ptid_t event_ptid, enum target_signal signal)
|
||||||
displaced_step_dump_bytes (gdb_stdlog, buf, sizeof (buf));
|
displaced_step_dump_bytes (gdb_stdlog, buf, sizeof (buf));
|
||||||
}
|
}
|
||||||
|
|
||||||
target_resume (ptid, 1, TARGET_SIGNAL_0);
|
if (gdbarch_software_single_step_p (gdbarch))
|
||||||
|
target_resume (ptid, 0, TARGET_SIGNAL_0);
|
||||||
|
else
|
||||||
|
target_resume (ptid, 1, TARGET_SIGNAL_0);
|
||||||
|
|
||||||
/* Done, we're stepping a thread. */
|
/* Done, we're stepping a thread. */
|
||||||
break;
|
break;
|
||||||
|
@ -1105,15 +1111,19 @@ maybe_software_singlestep (struct gdbarch *gdbarch, CORE_ADDR pc)
|
||||||
{
|
{
|
||||||
int hw_step = 1;
|
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 ()))
|
|
||||||
{
|
{
|
||||||
hw_step = 0;
|
if (use_displaced_stepping (gdbarch))
|
||||||
/* Do not pull these breakpoints until after a `wait' in
|
hw_step = 0;
|
||||||
`wait_for_inferior' */
|
else if (gdbarch_software_single_step (gdbarch, get_current_frame ()))
|
||||||
singlestep_breakpoints_inserted_p = 1;
|
{
|
||||||
singlestep_ptid = inferior_ptid;
|
hw_step = 0;
|
||||||
singlestep_pc = pc;
|
/* 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;
|
return hw_step;
|
||||||
}
|
}
|
||||||
|
@ -1179,7 +1189,8 @@ a command like `return' or `jump' to continue execution."));
|
||||||
comments in the handle_inferior event for dealing with 'random
|
comments in the handle_inferior event for dealing with 'random
|
||||||
signals' explain what we do instead. */
|
signals' explain what we do instead. */
|
||||||
if (use_displaced_stepping (gdbarch)
|
if (use_displaced_stepping (gdbarch)
|
||||||
&& tp->trap_expected
|
&& (tp->trap_expected
|
||||||
|
|| (step && gdbarch_software_single_step_p (gdbarch)))
|
||||||
&& sig == TARGET_SIGNAL_0)
|
&& sig == TARGET_SIGNAL_0)
|
||||||
{
|
{
|
||||||
if (!displaced_step_prepare (inferior_ptid))
|
if (!displaced_step_prepare (inferior_ptid))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue