aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbarch.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2017-06-10 00:24:05 +0200
committerSimon Marchi <simon.marchi@ericsson.com>2017-06-10 00:24:50 +0200
commit6d45d4b42b5b360c0b80259e101c01d650d0be23 (patch)
tree5cb8bbfb7fcc2b47f9b0749bc16b4cd8362bfab4 /gdb/gdbarch.c
parent9845682bda4149b5b3648f2d49a041aef5bc1af5 (diff)
downloadgdb-6d45d4b42b5b360c0b80259e101c01d650d0be23.zip
gdb-6d45d4b42b5b360c0b80259e101c01d650d0be23.tar.gz
gdb-6d45d4b42b5b360c0b80259e101c01d650d0be23.tar.bz2
gdbarch: Remove displaced_step_free_closure
The displaced_step_free_closure gdbarch hook allows architectures to free data they might have allocated to complete a displaced step. However, all architectures using that hook use the simple_displaced_step_free_closure provided in arch-utils.{c,h}, which does a simple xfree. We can remove it and do an xfree directly instead of calling the hook. gdb/ChangeLog: * gdbarch.sh (displaced_step_free_closure): Remove. * gdbarch.h, gdbarch.c: Re-generate. * aarch64-linux-tdep.c (aarch64_linux_init_abi): Don't set displaced_step_free_closure. * amd64-linux-tdep.c (amd64_linux_init_abi_common): Likewise. * arm-linux-tdep.c (arm_linux_init_abi): Likewise. * i386-linux-tdep.c (i386_linux_init_abi): Likewise. * rs6000-aix-tdep.c (rs6000_aix_init_osabi): Likewise. * rs6000-tdep.c (rs6000_gdbarch_init): Likewise. * s390-linux-tdep.c (s390_gdbarch_init): Likewise. * arch-utils.h (simple_displaced_step_free_closure): Remove. * arch-utils.c (simple_displaced_step_free_closure): Remove. * infrun.c (displaced_step_clear): Call xfree instead of gdbarch_displaced_step_free_closure.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 257c39f..e5efdfb 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -295,7 +295,6 @@ struct gdbarch
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;
gdbarch_relocate_instruction_ftype *relocate_instruction;
gdbarch_overlay_update_ftype *overlay_update;
@@ -443,7 +442,6 @@ gdbarch_alloc (const struct gdbarch_info *info,
gdbarch->skip_permanent_breakpoint = default_skip_permanent_breakpoint;
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;
gdbarch->relocate_instruction = NULL;
gdbarch->has_shared_address_space = default_has_shared_address_space;
@@ -656,8 +654,6 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* 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))
- log.puts ("\n\tdisplaced_step_free_closure");
if ((! gdbarch->displaced_step_location) != (! gdbarch->displaced_step_copy_insn))
log.puts ("\n\tdisplaced_step_location");
/* Skip verify of relocate_instruction, has predicate. */
@@ -912,9 +908,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: displaced_step_fixup = <%s>\n",
host_address_to_string (gdbarch->displaced_step_fixup));
fprintf_unfiltered (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,
@@ -3970,23 +3963,6 @@ set_gdbarch_displaced_step_fixup (struct gdbarch *gdbarch,
gdbarch->displaced_step_fixup = displaced_step_fixup;
}
-void
-gdbarch_displaced_step_free_closure (struct gdbarch *gdbarch, struct displaced_step_closure *closure)
-{
- gdb_assert (gdbarch != NULL);
- gdb_assert (gdbarch->displaced_step_free_closure != NULL);
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_free_closure called\n");
- gdbarch->displaced_step_free_closure (gdbarch, closure);
-}
-
-void
-set_gdbarch_displaced_step_free_closure (struct gdbarch *gdbarch,
- gdbarch_displaced_step_free_closure_ftype displaced_step_free_closure)
-{
- gdbarch->displaced_step_free_closure = displaced_step_free_closure;
-}
-
CORE_ADDR
gdbarch_displaced_step_location (struct gdbarch *gdbarch)
{