aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-07-19 17:51:25 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-07-19 17:51:25 +0000
commitc0edd9edadfe292d00ea18c410f73cafa2657beb (patch)
tree65c0dbd9e554f8e9aeb3af8151980d28802167ef /gdb/utils.c
parent3437afb19942280b83663ffbd0ff5e283d4744fb (diff)
downloadgdb-c0edd9edadfe292d00ea18c410f73cafa2657beb.zip
gdb-c0edd9edadfe292d00ea18c410f73cafa2657beb.tar.gz
gdb-c0edd9edadfe292d00ea18c410f73cafa2657beb.tar.bz2
gdb/
Make core files the process_stratum. * corefile.c (core_target): New variable. (core_file_command): Remove variable t, use core_target. * corelow.c (core_ops): Make it static. (init_core_ops): Change to process_stratum. Initialize CORE_TARGET. * defs.h (make_cleanup_unpush_target): New prototype. * gdbarch.h: Regenerate. * gdbarch.sh (core_pid_to_str): Remove core_stratum from its comment. * gdbcore.h (core_target): New declaration. * inf-ptrace.c (inf_ptrace_create_inferior, inf_ptrace_attach): New variables ops_already_pushed and back_to. Use push_target, make_cleanup_unpush_target and discard_cleanups calls. * record.c (record_open): Replace core_stratum by a core_bfd check. * target.c (target_is_pushed): New function. (find_core_target): Remove. * target.h (enum strata) <core_stratum>: Remove. (target_is_pushed): New declaration. (find_core_target): Remove declaration. * tracepoint.c (init_tfile_ops) <to_stratum>: Remove comment. * utils.c (do_unpush_target, make_cleanup_unpush_target): New functions. gdb/doc/ Make core files the process_stratum. * gdb.texinfo (Active Targets): Remove core_stratum. Include record_stratum example. gdb/testsuite/ Make core files the process_stratum. * gdb.base/corefile.exp (run: load core again) (run: sanity check we see the core file, run: with core) (run: core file is cleared, attach: load core again) (attach: sanity check we see the core file, attach: with core) (attach: core file is cleared): New tests. * gdb.base/coremaker.c (main): New parameters. Implement "sleep" argv.
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index a8beb37..0eaa050 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -352,6 +352,24 @@ make_cleanup_restore_integer (int *variable)
xfree);
}
+/* Helper for make_cleanup_unpush_target. */
+
+static void
+do_unpush_target (void *arg)
+{
+ struct target_ops *ops = arg;
+
+ unpush_target (ops);
+}
+
+/* Return a new cleanup that unpushes OPS. */
+
+struct cleanup *
+make_cleanup_unpush_target (struct target_ops *ops)
+{
+ return make_my_cleanup (&cleanup_chain, do_unpush_target, ops);
+}
+
struct cleanup *
make_my_cleanup2 (struct cleanup **pmy_chain, make_cleanup_ftype *function,
void *arg, void (*free_arg) (void *))