- bsd_kvm_ops.to_shortname = "kvm";
- bsd_kvm_ops.to_longname = "Kernel memory interface";
- bsd_kvm_ops.to_doc = "Use a kernel virtual memory image as a target.\n\
-Optionally specify the filename of a core dump.";
- bsd_kvm_ops.to_open = bsd_kvm_open;
- bsd_kvm_ops.to_close = bsd_kvm_close;
- bsd_kvm_ops.to_fetch_registers = bsd_kvm_fetch_registers;
- bsd_kvm_ops.to_xfer_memory = bsd_kvm_xfer_memory;
- bsd_kvm_ops.to_stratum = process_stratum;
- bsd_kvm_ops.to_has_memory = 1;
- bsd_kvm_ops.to_has_stack = 1;
- bsd_kvm_ops.to_has_registers = 1;
- bsd_kvm_ops.to_magic = OPS_MAGIC;
-
- add_target (&bsd_kvm_ops);
+ add_target (bsd_kvm_target_info, bsd_kvm_target_open);
+
+ add_prefix_cmd ("kvm", class_obscure, bsd_kvm_cmd, _("\
+Generic command for manipulating the kernel memory interface."),
+ &bsd_kvm_cmdlist, "kvm ", 0, &cmdlist);
+
+#ifndef HAVE_STRUCT_THREAD_TD_PCB
+ add_cmd ("proc", class_obscure, bsd_kvm_proc_cmd,
+ _("Set current context from proc address"), &bsd_kvm_cmdlist);
+#endif
+ add_cmd ("pcb", class_obscure, bsd_kvm_pcb_cmd,
+ /* i18n: PCB == "Process Control Block". */
+ _("Set current context from pcb address"), &bsd_kvm_cmdlist);
+
+ /* Some notes on the ptid usage on this target.
+
+ The pid field represents the kvm inferior instance. Currently,
+ we don't support multiple kvm inferiors, but we start at 1
+ anyway. The lwp field is set to != 0, in case the core wants to
+ refer to the whole kvm inferior with ptid(1,0,0).
+
+ If kvm is made to export running processes as gdb threads,
+ the following form can be used:
+ ptid (1, 1, 0) -> kvm inferior 1, in kernel
+ ptid (1, 1, 1) -> kvm inferior 1, process 1
+ ptid (1, 1, 2) -> kvm inferior 1, process 2
+ ptid (1, 1, n) -> kvm inferior 1, process n */
+
+ bsd_kvm_ptid = ptid_t (1, 1, 0);