ptrace and thread

From: David Xu (davidxu_at_freebsd.org)
Date: 01/14/04

  • Next message: David Brinegar: "Re: About removable disks, mountroot and sw-raid"
    Date: Wed, 14 Jan 2004 11:17:36 +0800
    To: arch@freebsd.org
    
    

    I am current working on debug support for KSE thread program, however I
    found
    ptrace interface is not thread-aware, in a threaded program, I need to
    get/set registers
    set for individual threads, current ptrace can not support that
    features, there are two
    ways to support these requirements:

    1. keep current ptrace interface, add a command for example
    PT_SETDTHREAD to
       set current thread for debug, and subsequent request for example
    PT_SETREGS and
       PT_GETREGS will work on the thread, for single thread process, the
    default current
       thread is always the first thread in the process, this way we needn't
    change legacy debugger
       code.

    2. introduce a second ptrace syscall, and accept a new parameter tid
    (thread id),
       the PT_SETREGS and PT_GETREGS will use the tid to operate on
    corresponding
       thread.

    For first method, I have a patch there:
    http://people.freebsd.org/~davidxu/kse/ptrace.diff
    The patch also includes some bits to support KSE debug, not just for
    pure 1:1 threading.

    David Xu

    _______________________________________________
    freebsd-arch@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-arch
    To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"


  • Next message: David Brinegar: "Re: About removable disks, mountroot and sw-raid"

    Relevant Pages