aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authorMarkus Metzger <markus.t.metzger@intel.com>2014-05-20 15:22:53 +0200
committerMarkus Metzger <markus.t.metzger@intel.com>2014-06-25 09:57:16 +0200
commit5fff78c4e0d938bb4fc1375792ffae02a134943c (patch)
tree21331de5e48cb6494002c76afa174a00051ea1ed /gdb/target.c
parent1d1f1ccb331f1fe9825c3bb6f6231a3aeb560d6f (diff)
downloadfsf-binutils-gdb-5fff78c4e0d938bb4fc1375792ffae02a134943c.zip
fsf-binutils-gdb-5fff78c4e0d938bb4fc1375792ffae02a134943c.tar.gz
fsf-binutils-gdb-5fff78c4e0d938bb4fc1375792ffae02a134943c.tar.bz2
gcore, target: allow target to prepare/cleanup for/after core file generation
Add new target functions to_prepare_to_generate_core and to_done_generating_core that are called before and after generating a core file, respectively. This allows targets to prepare for core file generation and to clean up afterwards. gdb/ * target.h (target_ops) <to_prepare_to_generate_core> <to_done_generating_core>: New. (target_prepare_to_generate_core, target_done_generating_core): New. * target.c (target_prepare_to_generate_core) (target_done_generating_core): New. * target-delegates.c: Regenerate. * gcore.c: (write_gcore_file): Rename to ... (write_gcore_file_1): ...this. (write_gcore_file): Call target_prepare_to_generate_core and target_done_generating_core.
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/target.c b/gdb/target.c
index 075425d..f384ed0 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -3606,6 +3606,22 @@ target_decr_pc_after_break (struct gdbarch *gdbarch)
return current_target.to_decr_pc_after_break (&current_target, gdbarch);
}
+/* See target.h. */
+
+void
+target_prepare_to_generate_core (void)
+{
+ current_target.to_prepare_to_generate_core (&current_target);
+}
+
+/* See target.h. */
+
+void
+target_done_generating_core (void)
+{
+ current_target.to_done_generating_core (&current_target);
+}
+
static void
debug_to_files_info (struct target_ops *target)
{