Messages in this thread Patch in this message | | | Date | Mon, 6 Mar 2000 20:09:18 +0100 | From | Pavel Machek <> | Subject | Allow debuger to examine real parent |
| |
Hi!
This patch enables debugger to examine original parent of traced process. That information is not available elsewhere.
Pavel
--- linux-2.3.48/include/asm-i386/ptrace.h.orig Tue Dec 9 19:57:09 1997 +++ linux-2.3.48/include/asm-i386/ptrace.h Mon Feb 28 22:42:10 2000 @@ -47,6 +47,8 @@ #define PTRACE_GETFPREGS 14 #define PTRACE_SETFPREGS 15 +#define PTRACE_GETPPID 20 + #ifdef __KERNEL__ #define user_mode(regs) ((VM_MASK & (regs)->eflags) || (3 & (regs)->xcs)) #define instruction_pointer(regs) ((regs)->eip) --- linux-2.3.48/arch/i386/kernel/ptrace.c.orig Mon Feb 28 02:20:12 2000 +++ linux-2.3.48/arch/i386/kernel/ptrace.c Mon Feb 28 22:42:10 2000 @@ -431,6 +431,12 @@ break; } + case PTRACE_GETPPID: { /* Who's your daddy? */ + unsigned long ppid = child->p_opptr->pid; + ret = put_user(ppid, (unsigned long *) data); + break; + } + default: ret = -EIO; break; -- The best software in life is free (not shareware)! Pavel GCM d? s-: !g p?:+ au- a--@ w+ v- C++@ UL+++ L++ N++ E++ W--- M- Y- R+
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |