lkml.org 
[lkml]   [2000]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectAllow 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/

    \
     
     \ /
      Last update: 2005-03-22 13:56    [W:0.020 / U:60.200 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site