From 0b21c939c0a54cb34f0810d1353e74009ad7176a Mon Sep 17 00:00:00 2001 From: das Date: Sat, 27 Nov 2004 06:46:59 +0000 Subject: Axe a.out core dump support. Neither older gdb binaries nor current bfd sources understand the present format. --- sys/kern/imgact_aout.c | 55 +------------------------------------------------- 1 file changed, 1 insertion(+), 54 deletions(-) (limited to 'sys/kern/imgact_aout.c') 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 #include #include -#include #include #include @@ -53,8 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include -#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" }; -- cgit v1.1