Re: ptrace and thread

From: Doug Rabson (dfr_at_nlsystems.com)
Date: 01/14/04

  • Next message: Simon L. Nielsen: "Re: Request for Comments: libarchive, bsdtar"
    To: David Xu <davidxu@freebsd.org>
    Date: 14 Jan 2004 12:33:17 +0000
    
    

    On Wed, 2004-01-14 at 03:17, David Xu wrote:
    > 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.

    As far as option 2 goes, I think the HP ttrace syscall might be a useful
    model to follow. You can read the manpage at:
    http://docs.hp.com/cgi-bin/onlinedocs.py?mpn=B2355-60103&service=hpux&path=00/13/1384&title=HP-UX%20Reference%20%2811i%20v2%29

    _______________________________________________
    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: Simon L. Nielsen: "Re: Request for Comments: libarchive, bsdtar"