aboutsummaryrefslogtreecommitdiff
path: root/sys/vm
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2015-11-12 22:00:59 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2015-11-12 22:00:59 +0000
commit645743ea99829e6d578cca5a580cf0a4102fb7dd (patch)
treeae4572767afc71624454282e5da6abcbe605b730 /sys/vm
parentacaf20cbdeb1b26cae446b7e870aa470a82b0628 (diff)
downloadsrc-645743ea99829e6d578cca5a580cf0a4102fb7dd.tar.gz
src-645743ea99829e6d578cca5a580cf0a4102fb7dd.zip
Export various helper variables describing the layout and size of
certain kernel structures for use by debuggers. This mostly aids in examining cores from a kernel without debug symbols as a debugger can infer these values if debug symbols are available. One set of variables describes the layout of 'struct linker_file' to walk the list of loaded kernel modules. A second set of variables describes the layout of 'struct proc' and 'struct thread' to walk the list of processes in the kernel and the threads in each process. The 'pcb_size' variable is used to index into the stoppcbs[] array. The 'vm_maxuser_address' is used to distinguish kernel virtual addresses from user addresses. This doesn't have to be perfect, and 'vm_maxuser_address' is a cheap and simple way to differentiate kernel pointers from simple values like TIDs and PIDs. While here, annotate the fields in struct pcb used by kgdb on amd64 and i386 to note that their ABI should be preserved. Annotations for other platforms will be added in the future. Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D3773
Notes
Notes: svn path=/head/; revision=290728
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_kern.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c
index a636d74dd398..a05c26384780 100644
--- a/sys/vm/vm_kern.c
+++ b/sys/vm/vm_kern.c
@@ -94,6 +94,9 @@ vm_map_t pipe_map;
const void *zero_region;
CTASSERT((ZERO_REGION_SIZE & PAGE_MASK) == 0);
+/* NB: Used by kernel debuggers. */
+const u_long vm_maxuser_address = VM_MAXUSER_ADDRESS;
+
SYSCTL_ULONG(_vm, OID_AUTO, min_kernel_address, CTLFLAG_RD,
SYSCTL_NULL_ULONG_PTR, VM_MIN_KERNEL_ADDRESS, "Min kernel address");