diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2009-09-29 00:53:04 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2009-09-29 00:53:04 +0000 |
commit | 99e40580307d91e399af1c0293a6676b10efefea (patch) | |
tree | 3c951a5f939f575645b767865063ddbc6ddfd0b3 /gdb/gdbarch.c | |
parent | 69368a60a4878ec4ef1060732020e9eaf19b32b0 (diff) | |
download | gdb-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/gdbarch.c')
-rw-r--r-- | gdb/gdbarch.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 2ae3835..6c13dc8 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -232,6 +232,7 @@ struct gdbarch gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint; ULONGEST max_insn_length; gdbarch_displaced_step_copy_insn_ftype *displaced_step_copy_insn; + gdbarch_displaced_step_hw_singlestep_ftype *displaced_step_hw_singlestep; gdbarch_displaced_step_fixup_ftype *displaced_step_fixup; gdbarch_displaced_step_free_closure_ftype *displaced_step_free_closure; gdbarch_displaced_step_location_ftype *displaced_step_location; @@ -371,6 +372,7 @@ struct gdbarch startup_gdbarch = 0, /* skip_permanent_breakpoint */ 0, /* max_insn_length */ 0, /* displaced_step_copy_insn */ + default_displaced_step_hw_singlestep, /* displaced_step_hw_singlestep */ 0, /* displaced_step_fixup */ NULL, /* displaced_step_free_closure */ NULL, /* displaced_step_location */ @@ -464,6 +466,7 @@ gdbarch_alloc (const struct gdbarch_info *info, gdbarch->elf_make_msymbol_special = default_elf_make_msymbol_special; gdbarch->coff_make_msymbol_special = default_coff_make_msymbol_special; gdbarch->register_reggroup_p = default_register_reggroup_p; + gdbarch->displaced_step_hw_singlestep = default_displaced_step_hw_singlestep; gdbarch->displaced_step_fixup = NULL; gdbarch->displaced_step_free_closure = NULL; gdbarch->displaced_step_location = NULL; @@ -627,6 +630,7 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of skip_permanent_breakpoint, has predicate */ /* Skip verify of max_insn_length, has predicate */ /* Skip verify of displaced_step_copy_insn, has predicate */ + /* Skip verify of displaced_step_hw_singlestep, invalid_p == 0 */ /* Skip verify of displaced_step_fixup, has predicate */ if ((! gdbarch->displaced_step_free_closure) != (! gdbarch->displaced_step_copy_insn)) fprintf_unfiltered (log, "\n\tdisplaced_step_free_closure"); @@ -791,6 +795,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: displaced_step_free_closure = <%s>\n", host_address_to_string (gdbarch->displaced_step_free_closure)); fprintf_unfiltered (file, + "gdbarch_dump: displaced_step_hw_singlestep = <%s>\n", + host_address_to_string (gdbarch->displaced_step_hw_singlestep)); + fprintf_unfiltered (file, "gdbarch_dump: displaced_step_location = <%s>\n", host_address_to_string (gdbarch->displaced_step_location)); fprintf_unfiltered (file, @@ -3145,6 +3152,23 @@ set_gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch, } int +gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, struct displaced_step_closure *closure) +{ + gdb_assert (gdbarch != NULL); + gdb_assert (gdbarch->displaced_step_hw_singlestep != NULL); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_hw_singlestep called\n"); + return gdbarch->displaced_step_hw_singlestep (gdbarch, closure); +} + +void +set_gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, + gdbarch_displaced_step_hw_singlestep_ftype displaced_step_hw_singlestep) +{ + gdbarch->displaced_step_hw_singlestep = displaced_step_hw_singlestep; +} + +int gdbarch_displaced_step_fixup_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); |