1 1.4 christos /* $NetBSD: debugsyms.c,v 1.4 2015/10/06 22:13:39 christos Exp $ */ 2 1.1 joerg /* 3 1.1 joerg * This file is in the public domain. 4 1.1 joerg */ 5 1.1 joerg 6 1.1 joerg #include <sys/cdefs.h> 7 1.4 christos __KERNEL_RCSID(0, "$NetBSD: debugsyms.c,v 1.4 2015/10/06 22:13:39 christos Exp $"); 8 1.1 joerg 9 1.1 joerg #define _CALLOUT_PRIVATE 10 1.1 joerg #define __MUTEX_PRIVATE 11 1.4 christos #define __KAUTH_PRIVATE 12 1.1 joerg 13 1.1 joerg #include <sys/param.h> 14 1.1 joerg #include <sys/lwp.h> 15 1.1 joerg #include <sys/mbuf.h> 16 1.1 joerg #include <sys/mutex.h> 17 1.1 joerg #include <sys/proc.h> 18 1.1 joerg #include <sys/sched.h> 19 1.1 joerg #include <sys/sleepq.h> 20 1.1 joerg #include <sys/time.h> 21 1.1 joerg #include <sys/ucontext.h> 22 1.1 joerg #include <sys/uio.h> 23 1.1 joerg #include <sys/un.h> 24 1.1 joerg #include <sys/unpcb.h> 25 1.1 joerg #include <sys/vnode.h> 26 1.4 christos #include <sys/specificdata.h> 27 1.4 christos #include <sys/kauth.h> 28 1.2 ad 29 1.2 ad /* 30 1.2 ad * Without a dummy function referencing some of the types, gcc will 31 1.2 ad * not emit any debug information. 32 1.2 ad */ 33 1.2 ad proc_t *_debugsym_dummyfunc(vnode_t *vp); 34 1.2 ad 35 1.2 ad proc_t * 36 1.2 ad _debugsym_dummyfunc(vnode_t *vp) 37 1.2 ad { 38 1.4 christos struct kauth_cred *cr = (kauth_cred_t)vp; 39 1.2 ad 40 1.4 christos return cr->cr_uid ? ((lwp_t *)vp->v_mount)->l_proc : NULL; 41 1.2 ad } 42