Axe a.out core dump support. Neither older gdb binaries nor current
bfd sources understand the present format.
This commit is contained in:
parent
c5ac569a4b
commit
1eecfae3e5
@ -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,
|
||||
@ -262,56 +259,6 @@ exec_aout_imgact(imgp)
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -206,6 +206,4 @@ struct user {
|
||||
struct kinfo_proc u_kproc; /* eproc */
|
||||
};
|
||||
|
||||
void fill_user(struct proc *, struct user *);
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user