diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2010-07-19 17:51:22 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2010-07-19 17:51:22 +0000 |
commit | aa2614659d7863f1afe4da2251312f7da9236ea5 (patch) | |
tree | 1663ce4a8923f8bfaf94c63ea6c5a8766d0d1f4d /gdb/corefile.c | |
parent | e7a84eb6873575517586ae3df2844a35c7d031fc (diff) | |
download | gdb-aa2614659d7863f1afe4da2251312f7da9236ea5.tar.gz |
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/corefile.c')
-rw-r--r-- | gdb/corefile.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gdb/corefile.c b/gdb/corefile.c index 7c1db864f76..c6efba7da25 100644 --- a/gdb/corefile.c +++ b/gdb/corefile.c @@ -59,6 +59,10 @@ static int exec_file_hook_count = 0; /* size of array */ /* Binary file diddling handle for the core file. */ bfd *core_bfd = NULL; + +/* corelow.c target (if included for this gdb target). */ + +struct target_ops *core_target; /* Backward compatability with old way of specifying core files. */ @@ -66,18 +70,15 @@ bfd *core_bfd = NULL; void core_file_command (char *filename, int from_tty) { - struct target_ops *t; - dont_repeat (); /* Either way, seems bogus. */ - t = find_core_target (); - if (t == NULL) + if (core_target == NULL) error (_("GDB can't read core files on this machine.")); if (!filename) - (t->to_detach) (t, filename, from_tty); + (core_target->to_detach) (core_target, filename, from_tty); else - (t->to_open) (filename, from_tty); + (core_target->to_open) (filename, from_tty); } |