From 62919d788b37bba3390d9b9ed29ff5220d09840e Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Thu, 30 Jun 2005 07:49:22 +0000 Subject: Jumbo-commit to enhance 32 bit application support on 64 bit kernels. This is good enough to be able to run a RELENG_4 gdb binary against a RELENG_4 application, along with various other tools (eg: 4.x gcore). We use this at work. ia32_reg.[ch]: handle the 32 bit register file format, used by ptrace, procfs and core dumps. procfs_*regs.c: vary the format of proc/XXX/*regs depending on the client and target application. procfs_map.c: Don't print a 64 bit value to 32 bit consumers, or their sscanf fails. They expect an unsigned long. imgact_elf.c: produce a valid 32 bit coredump for 32 bit apps. sys_process.c: handle 32 bit consumers debugging 32 bit targets. Note that 64 bit consumers can still debug 32 bit targets. IA64 has got stubs for ia32_reg.c. Known limitations: a 5.x/6.x gdb uses get/setcontext(), which isn't implemented in the 32/64 wrapper yet. We also make a tiny patch to gdb pacify it over conflicting formats of ld-elf.so.1. Approved by: re --- sys/sys/ptrace.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'sys/sys/ptrace.h') diff --git a/sys/sys/ptrace.h b/sys/sys/ptrace.h index 0058683da9b0..93b1a7d6d0fc 100644 --- a/sys/sys/ptrace.h +++ b/sys/sys/ptrace.h @@ -135,6 +135,17 @@ int proc_read_dbregs(struct thread *_td, struct dbreg *_dbreg); int proc_write_dbregs(struct thread *_td, struct dbreg *_dbreg); int proc_sstep(struct thread *_td); int proc_rwmem(struct proc *_p, struct uio *_uio); +#ifdef COMPAT_IA32 +struct reg32; +struct fpreg32; +struct dbreg32; +int proc_read_regs32(struct thread *_td, struct reg32 *_reg32); +int proc_write_regs32(struct thread *_td, struct reg32 *_reg32); +int proc_read_fpregs32(struct thread *_td, struct fpreg32 *_fpreg32); +int proc_write_fpregs32(struct thread *_td, struct fpreg32 *_fpreg32); +int proc_read_dbregs32(struct thread *_td, struct dbreg32 *_dbreg32); +int proc_write_dbregs32(struct thread *_td, struct dbreg32 *_dbreg32); +#endif #else /* !_KERNEL */ #include -- cgit v1.2.3