diff options
author | das <das@FreeBSD.org> | 2004-11-27 06:46:59 +0000 |
---|---|---|
committer | das <das@FreeBSD.org> | 2004-11-27 06:46:59 +0000 |
commit | 0b21c939c0a54cb34f0810d1353e74009ad7176a (patch) | |
tree | 6aa4584b2997dda4c8f1afb8de4c92af8d5cf732 /sys | |
parent | 3ccad749b08338ad8ae5538ef71034dffe656f1a (diff) | |
download | FreeBSD-src-0b21c939c0a54cb34f0810d1353e74009ad7176a.zip FreeBSD-src-0b21c939c0a54cb34f0810d1353e74009ad7176a.tar.gz |
Axe a.out core dump support. Neither older gdb binaries nor current
bfd sources understand the present format.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/imgact_aout.c | 55 | ||||
-rw-r--r-- | sys/kern/kern_proc.c | 13 | ||||
-rw-r--r-- | sys/sys/user.h | 2 |
3 files changed, 1 insertions, 69 deletions
diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c index e2334a9..792ba96 100644 --- a/sys/kern/imgact_aout.c +++ b/sys/kern/imgact_aout.c @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include <sys/sysent.h> #include <sys/systm.h> #include <sys/vnode.h> -#include <sys/user.h> #include <machine/frame.h> #include <machine/md_var.h> @@ -53,8 +52,6 @@ __FBSDID("$FreeBSD$"); #include <vm/vm_object.h> #include <vm/vm_param.h> -#define uarea_pages 1 - static int exec_aout_imgact(struct image_params *imgp); static int aout_fixup(register_t **stack_base, struct image_params *imgp); @@ -73,7 +70,7 @@ struct sysentvec aout_sysvec = { &szsigcode, NULL, "FreeBSD a.out", - aout_coredump, + NULL, NULL, MINSIGSTKSZ, PAGE_SIZE, @@ -263,56 +260,6 @@ exec_aout_imgact(imgp) } /* - * Dump core, into a file named as described in the comments for - * expand_name(), unless the process was setuid/setgid. - */ -int -aout_coredump(td, vp, limit) - register struct thread *td; - register struct vnode *vp; - off_t limit; -{ - struct proc *p = td->td_proc; - register struct ucred *cred = td->td_ucred; - register struct vmspace *vm = p->p_vmspace; - char *tempuser; - int error; - - if (ctob((uarea_pages + kstack_pages) - + vm->vm_dsize + vm->vm_ssize) >= limit) - return (EFAULT); - tempuser = malloc(ctob(uarea_pages + kstack_pages), M_TEMP, - M_WAITOK | M_ZERO); - if (tempuser == NULL) - return (ENOMEM); - PROC_LOCK(p); - fill_user(p, (struct user *)tempuser); - PROC_UNLOCK(p); - bcopy(td->td_frame, - tempuser + ctob(uarea_pages) + - ((caddr_t)td->td_frame - (caddr_t)td->td_kstack), - sizeof(struct trapframe)); - error = vn_rdwr(UIO_WRITE, vp, (caddr_t)tempuser, - ctob(uarea_pages + kstack_pages), - (off_t)0, UIO_SYSSPACE, IO_UNIT, cred, NOCRED, - (int *)NULL, td); - free(tempuser, M_TEMP); - if (error == 0) - error = vn_rdwr(UIO_WRITE, vp, vm->vm_daddr, - (int)ctob(vm->vm_dsize), - (off_t)ctob(uarea_pages + kstack_pages), UIO_USERSPACE, - IO_UNIT | IO_DIRECT, cred, NOCRED, (int *) NULL, td); - if (error == 0) - error = vn_rdwr_inchunks(UIO_WRITE, vp, - (caddr_t)trunc_page(p->p_sysent->sv_usrstack - - ctob(vm->vm_ssize)), round_page(ctob(vm->vm_ssize)), - (off_t)ctob(uarea_pages + kstack_pages) + - ctob(vm->vm_dsize), UIO_USERSPACE, - IO_UNIT | IO_DIRECT, cred, NOCRED, NULL, td); - return (error); -} - -/* * Tell kern_execve.c about it, with a little help from the linker. */ static struct execsw aout_execsw = { exec_aout_imgact, "a.out" }; diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 75f19ad..03b0ab2 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -800,19 +800,6 @@ fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp) kp->ki_ppid = p->p_pptr->p_pid; } -/* - * Fill a 'struct user' for backwards compatibility with a.out core dumps. - * This is used by the aout, linux, and pecoff modules. - */ -void -fill_user(struct proc *p, struct user *u) -{ - - PROC_LOCK_ASSERT(p, MA_OWNED); - bcopy(&p->p_stats, &u->u_stats, sizeof(struct pstats)); - fill_kinfo_proc(p, &u->u_kproc); -} - struct pstats * pstats_alloc(void) { diff --git a/sys/sys/user.h b/sys/sys/user.h index 145b578..d8a3657 100644 --- a/sys/sys/user.h +++ b/sys/sys/user.h @@ -206,6 +206,4 @@ struct user { struct kinfo_proc u_kproc; /* eproc */ }; -void fill_user(struct proc *, struct user *); - #endif |