summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2015-11-12 22:00:59 +0000
committerjhb <jhb@FreeBSD.org>2015-11-12 22:00:59 +0000
commitc1d9f70889401a68e5b3d9d51b1bc7fe699389ae (patch)
treeae4572767afc71624454282e5da6abcbe605b730 /sys/amd64
parent18e0d6dd27063c880b6a6ff413d39269ca3e42cb (diff)
downloadFreeBSD-src-c1d9f70889401a68e5b3d9d51b1bc7fe699389ae.zip
FreeBSD-src-c1d9f70889401a68e5b3d9d51b1bc7fe699389ae.tar.gz
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
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/include/pcb.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/sys/amd64/include/pcb.h b/sys/amd64/include/pcb.h
index 4bf9a4f..3f8d4c7 100644
--- a/sys/amd64/include/pcb.h
+++ b/sys/amd64/include/pcb.h
@@ -44,15 +44,19 @@
#include <machine/segments.h>
#ifdef __amd64__
+/*
+ * NB: The fields marked with (*) are used by kernel debuggers. Their
+ * ABI should be preserved.
+ */
struct pcb {
- register_t pcb_r15;
- register_t pcb_r14;
- register_t pcb_r13;
- register_t pcb_r12;
- register_t pcb_rbp;
- register_t pcb_rsp;
- register_t pcb_rbx;
- register_t pcb_rip;
+ register_t pcb_r15; /* (*) */
+ register_t pcb_r14; /* (*) */
+ register_t pcb_r13; /* (*) */
+ register_t pcb_r12; /* (*) */
+ register_t pcb_rbp; /* (*) */
+ register_t pcb_rsp; /* (*) */
+ register_t pcb_rbx; /* (*) */
+ register_t pcb_rip; /* (*) */
register_t pcb_fsbase;
register_t pcb_gsbase;
register_t pcb_kgsbase;
OpenPOWER on IntegriCloud