Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src



Module Name:    src
Committed By:   kamil
Date:           Thu Dec 15 12:04:18 UTC 2016

Modified Files:
        src/distrib/sets/lists/comp: md.amd64 md.i386
        src/sys/arch/amd64/amd64: machdep.c netbsd32_machdep.c
            process_machdep.c trap.c
        src/sys/arch/amd64/conf: files.amd64
        src/sys/arch/amd64/include: proc.h ptrace.h userret.h
        src/sys/arch/i386/conf: files.i386
        src/sys/arch/i386/i386: machdep.c process_machdep.c
        src/sys/arch/i386/include: proc.h ptrace.h userret.h
        src/sys/arch/x86/include: Makefile dbregs.h
        src/sys/arch/x86/x86: vm_machdep.c
        src/sys/arch/xen/conf: files.xen
        src/sys/compat/netbsd32: netbsd32_ptrace.c
        src/sys/kern: sys_ptrace.c sys_ptrace_common.c
        src/sys/sys: ptrace.h
Added Files:
        src/sys/arch/x86/x86: dbregs.c

Log Message:
Add support for hardware assisted watchpoints/breakpoints API in ptrace(2)

Add new ptrace(2) calls:
 - PT_COUNT_WATCHPOINTS - count the number of available hardware watchpoints
 - PT_READ_WATCHPOINT   - read struct ptrace_watchpoint from the kernel state
 - PT_WRITE_WATCHPOINT  - write new struct ptrace_watchpoint state, this
                          includes enabling and disabling watchpoints

The ptrace_watchpoint structure contains MI and MD parts:

typedef struct ptrace_watchpoint {
        int             pw_index;       /* HW Watchpoint ID (count from 0) */
        lwpid_t         pw_lwpid;       /* LWP described */
        struct mdpw     pw_md;          /* MD fields */
} ptrace_watchpoint_t;

For example amd64 defines MD as follows:
struct mdpw {
        void    *md_address;
        int      md_condition;
        int      md_length;
};

These calls are protected with the __HAVE_PTRACE_WATCHPOINTS guard.

Tested on amd64, initial support added for i386 and XEN.

Sponsored by <The NetBSD Foundation>


To generate a diff of this commit:
cvs rdiff -u -r1.239 -r1.240 src/distrib/sets/lists/comp/md.amd64
cvs rdiff -u -r1.159 -r1.160 src/distrib/sets/lists/comp/md.i386
cvs rdiff -u -r1.237 -r1.238 src/sys/arch/amd64/amd64/machdep.c
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/amd64/amd64/netbsd32_machdep.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/amd64/amd64/process_machdep.c
cvs rdiff -u -r1.87 -r1.88 src/sys/arch/amd64/amd64/trap.c
cvs rdiff -u -r1.87 -r1.88 src/sys/arch/amd64/conf/files.amd64
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/amd64/include/proc.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/amd64/include/ptrace.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/amd64/include/userret.h
cvs rdiff -u -r1.375 -r1.376 src/sys/arch/i386/conf/files.i386
cvs rdiff -u -r1.766 -r1.767 src/sys/arch/i386/i386/machdep.c
cvs rdiff -u -r1.86 -r1.87 src/sys/arch/i386/i386/process_machdep.c
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/i386/include/proc.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/i386/include/ptrace.h
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/include/userret.h
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/x86/include/Makefile
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x86/include/dbregs.h
cvs rdiff -u -r0 -r1.1 src/sys/arch/x86/x86/dbregs.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/x86/x86/vm_machdep.c
cvs rdiff -u -r1.142 -r1.143 src/sys/arch/xen/conf/files.xen
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/netbsd32/netbsd32_ptrace.c
cvs rdiff -u -r1.2 -r1.3 src/sys/kern/sys_ptrace.c
cvs rdiff -u -r1.6 -r1.7 src/sys/kern/sys_ptrace_common.c
cvs rdiff -u -r1.49 -r1.50 src/sys/sys/ptrace.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index