Subject: Re: "target kcore" as a synonym for "target kvm"
To: None <tech-toolchain@netbsd.org>
From: Pavel Cahyna <pavel@netbsd.org>
List: tech-toolchain
Date: 12/10/2006 22:27:35
On Sun, Dec 10, 2006 at 09:29:51PM +0100, Hubert Feyrer wrote:
> On Sun, 10 Dec 2006, Nathan J. Williams wrote:
> >>"target kcore" was a well-known and documented gdb command for kernel
> >>debugging. In GDB6 it was replaced by "target kvm". I've made a patch
> >>which adds a "target kcore" compatiblility alias. To be applied under
> >>gnu/dist/gdb6/gdb.
> >
> >I don't like this, because I think it has no chance of being accepted
> >into upstream GDB sources.
>
> Besides updating documentation (who'll do that, volunteers), maybe we can have
> the patch and make it print a warning that users should now use 'target kvm'?
Documentation is only a part of the proble, people are used to
"target kcore", we should keep it for some time.
Here is an updated patch.
*** bsd-kvm.c.~1.3.~ Sun Jul 2 23:04:40 2006
--- bsd-kvm.c Sun Dec 10 22:20:08 2006
***************
*** 57,62 ****
--- 57,63 ----
/* Target ops for libkvm interface. */
static struct target_ops bsd_kvm_ops;
+ static struct target_ops bsd_kcore_ops;
static void
bsd_kvm_open (char *filename, int from_tty)
***************
*** 99,104 ****
--- 100,112 ----
}
static void
+ bsd_kcore_open (char *filename, int from_tty)
+ {
+ warning(_("target kcore is deprecated and will be removed, use target kvm"));
+ bsd_kvm_open (filename, from_tty);
+ }
+
+ static void
bsd_kvm_close (int quitting)
{
if (core_kd)
***************
*** 327,333 ****
--- 335,348 ----
bsd_kvm_ops.to_has_registers = 1;
bsd_kvm_ops.to_magic = OPS_MAGIC;
+ bsd_kcore_ops = bsd_kvm_ops;
+ bsd_kcore_ops.to_shortname = "kcore";
+ bsd_kcore_ops.to_longname = _("Kernel memory interface");
+ bsd_kcore_ops.to_doc = _("Deprecated synonym for the kvm target");
+ bsd_kcore_ops.to_open = bsd_kcore_open;
+
add_target (&bsd_kvm_ops);
+ add_target (&bsd_kcore_ops);
add_prefix_cmd ("kvm", class_obscure, bsd_kvm_cmd, _("\
Generic command for manipulating the kernel memory interface."),