aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.h
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.h
parent1d1f1ccb331f1fe9825c3bb6f6231a3aeb560d6f (diff)
downloadgdb-5fff78c4e0d938bb4fc1375792ffae02a134943c.zip
gdb-5fff78c4e0d938bb4fc1375792ffae02a134943c.tar.gz
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.h')
-rw-r--r--gdb/target.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/target.h b/gdb/target.h
index e563f2f..96d5cb1 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -1109,6 +1109,14 @@ struct target_ops
struct gdbarch *gdbarch)
TARGET_DEFAULT_FUNC (default_target_decr_pc_after_break);
+ /* Prepare to generate a core file. */
+ void (*to_prepare_to_generate_core) (struct target_ops *)
+ TARGET_DEFAULT_IGNORE ();
+
+ /* Cleanup after generating a core file. */
+ void (*to_done_generating_core) (struct target_ops *)
+ TARGET_DEFAULT_IGNORE ();
+
int to_magic;
/* Need sub-structure for target machine related rather than comm related?
*/
@@ -2261,4 +2269,10 @@ extern CORE_ADDR forward_target_decr_pc_after_break (struct target_ops *ops,
/* See to_decr_pc_after_break. */
extern CORE_ADDR target_decr_pc_after_break (struct gdbarch *gdbarch);
+/* See to_prepare_to_generate_core. */
+extern void target_prepare_to_generate_core (void);
+
+/* See to_done_generating_core. */
+extern void target_done_generating_core (void);
+
#endif /* !defined (TARGET_H) */