head	1.33;
access;
symbols
	netbsd-9-5-RELEASE:1.31
	perseant-exfatfs-base-20250801:1.33
	perseant-exfatfs-base-20240630:1.33
	perseant-exfatfs:1.33.0.6
	perseant-exfatfs-base:1.33
	netbsd-8-3-RELEASE:1.28.4.1
	netbsd-9-4-RELEASE:1.31
	netbsd-9-3-RELEASE:1.31
	cjep_sun2x:1.33.0.4
	cjep_sun2x-base:1.33
	cjep_staticlib_x-base1:1.33
	netbsd-9-2-RELEASE:1.31
	cjep_staticlib_x:1.33.0.2
	cjep_staticlib_x-base:1.33
	netbsd-9-1-RELEASE:1.31
	phil-wifi-20200421:1.32
	phil-wifi-20200411:1.32
	is-mlppp:1.31.0.4
	is-mlppp-base:1.31
	phil-wifi-20200406:1.32
	netbsd-8-2-RELEASE:1.28.4.1
	netbsd-9-0-RELEASE:1.31
	netbsd-9-0-RC2:1.31
	netbsd-9-0-RC1:1.31
	phil-wifi-20191119:1.31
	netbsd-9:1.31.0.2
	netbsd-9-base:1.31
	phil-wifi-20190609:1.30
	netbsd-8-1-RELEASE:1.28.4.1
	netbsd-8-1-RC1:1.28.4.1
	pgoyette-compat-merge-20190127:1.29.2.1
	pgoyette-compat-20190127:1.30
	pgoyette-compat-20190118:1.30
	pgoyette-compat-1226:1.30
	pgoyette-compat-1126:1.30
	pgoyette-compat-1020:1.30
	pgoyette-compat-0930:1.30
	pgoyette-compat-0906:1.30
	pgoyette-compat-0728:1.29
	netbsd-8-0-RELEASE:1.28.4.1
	phil-wifi:1.29.0.4
	phil-wifi-base:1.29
	pgoyette-compat-0625:1.29
	netbsd-8-0-RC2:1.28.4.1
	pgoyette-compat-0521:1.29
	pgoyette-compat-0502:1.29
	pgoyette-compat-0422:1.29
	netbsd-8-0-RC1:1.28.4.1
	pgoyette-compat-0415:1.29
	pgoyette-compat-0407:1.29
	pgoyette-compat-0330:1.29
	pgoyette-compat-0322:1.29
	pgoyette-compat-0315:1.29
	pgoyette-compat:1.29.0.2
	pgoyette-compat-base:1.29
	matt-nb8-mediatek:1.28.0.6
	matt-nb8-mediatek-base:1.28
	netbsd-8:1.28.0.4
	netbsd-8-base:1.28
	prg-localcount2-base3:1.28
	prg-localcount2-base2:1.28
	prg-localcount2-base1:1.28
	prg-localcount2:1.28.0.2
	prg-localcount2-base:1.28
	pgoyette-localcount-20170426:1.28
	bouyer-socketcan-base1:1.28
	pgoyette-localcount-20170320:1.27
	bouyer-socketcan:1.11.0.2
	bouyer-socketcan-base:1.11
	pgoyette-localcount:1.9.0.2
	pgoyette-localcount-20170107:1.9;
locks; strict;
comment	@# @;


1.33
date	2020.10.01.18.21.11;	author kamil;	state dead;
branches;
next	1.32;
commitid	pqJAbo98Kfv1heqC;

1.32
date	2020.04.02.11.19.09;	author kamil;	state Exp;
branches;
next	1.31;
commitid	3RNsx6wc4UHeNN2C;

1.31
date	2019.06.14.16.11.11;	author kamil;	state Exp;
branches;
next	1.30;
commitid	mNh4r4EP978cParB;

1.30
date	2018.08.05.13.07.33;	author kamil;	state Exp;
branches;
next	1.29;
commitid	cp7nzxNesySdRVMA;

1.29
date	2017.08.28.00.46.07;	author kamil;	state Exp;
branches
	1.29.2.1
	1.29.4.1;
next	1.28;
commitid	MFC5MK9lwTGREU4A;

1.28
date	2017.04.08.01.08.36;	author kamil;	state Exp;
branches
	1.28.4.1;
next	1.27;
commitid	lzqBHBXGSUYnrFMz;

1.27
date	2017.03.03.07.11.49;	author kamil;	state Exp;
branches;
next	1.26;
commitid	MMjXHzOE2JRfC4Iz;

1.26
date	2017.03.03.07.03.11;	author kamil;	state Exp;
branches;
next	1.25;
commitid	iI6mjsal633nz4Iz;

1.25
date	2017.03.02.14.25.41;	author kamil;	state Exp;
branches;
next	1.24;
commitid	R15DA15g1BN93ZHz;

1.24
date	2017.02.28.13.10.54;	author kamil;	state Exp;
branches;
next	1.23;
commitid	fIwbU0QIVBFeHIHz;

1.23
date	2017.02.20.03.37.24;	author kamil;	state Exp;
branches;
next	1.22;
commitid	tcvLiZXAltSHMDGz;

1.22
date	2017.02.17.21.22.02;	author kamil;	state Exp;
branches;
next	1.21;
commitid	pcvz7pkgCisxLlGz;

1.21
date	2017.02.14.18.38.07;	author kamil;	state Exp;
branches;
next	1.20;
commitid	iGxViTr81oEGXWFz;

1.20
date	2017.02.13.15.29.18;	author kamil;	state Exp;
branches;
next	1.19;
commitid	ATrAJZr11IoIWNFz;

1.19
date	2017.02.12.06.16.33;	author kamil;	state Exp;
branches;
next	1.18;
commitid	kgzBkpRbeFE5VCFz;

1.18
date	2017.02.12.05.21.34;	author kamil;	state Exp;
branches;
next	1.17;
commitid	Q8fqfPyNS6Y0CCFz;

1.17
date	2017.02.11.19.10.04;	author kamil;	state Exp;
branches;
next	1.16;
commitid	nAZ6kargilo8dzFz;

1.16
date	2017.02.08.14.53.50;	author kamil;	state Exp;
branches;
next	1.15;
commitid	J3DI3dMTWdJvU9Fz;

1.15
date	2017.02.08.03.44.41;	author kamil;	state Exp;
branches;
next	1.14;
commitid	uFtv2cXdJlIL96Fz;

1.14
date	2017.02.07.16.15.05;	author kamil;	state Exp;
branches;
next	1.13;
commitid	VNCxdMvucVJUn2Fz;

1.13
date	2017.01.26.01.12.13;	author kamil;	state Exp;
branches;
next	1.12;
commitid	0ACr02BrCFhuMpDz;

1.12
date	2017.01.26.01.04.23;	author kamil;	state Exp;
branches;
next	1.11;
commitid	T76wuJ0jtmqAJpDz;

1.11
date	2017.01.14.01.36.28;	author kamil;	state Exp;
branches
	1.11.2.1;
next	1.10;
commitid	WX6tA34u0OYhiSBz;

1.10
date	2017.01.08.04.27.36;	author kamil;	state Exp;
branches;
next	1.9;
commitid	kLWQ3Fkvao12r7Bz;

1.9
date	2016.12.31.20.57.15;	author kamil;	state Exp;
branches
	1.9.2.1;
next	1.8;
commitid	FWLqs4TCjGeiabAz;

1.8
date	2016.12.26.08.43.55;	author kamil;	state Exp;
branches;
next	1.7;
commitid	bhGWYgUTq3Ruhtzz;

1.7
date	2016.12.26.03.24.11;	author kamil;	state Exp;
branches;
next	1.6;
commitid	SfbstnLTaPgHvrzz;

1.6
date	2016.12.24.05.43.31;	author kamil;	state Exp;
branches;
next	1.5;
commitid	ZKnnpkcOJmVolczz;

1.5
date	2016.12.19.03.19.37;	author kamil;	state Exp;
branches;
next	1.4;
commitid	Um4WiQwVYIDMHxyz;

1.4
date	2016.12.15.12.42.38;	author kamil;	state Exp;
branches;
next	1.3;
commitid	7yBYKaBBGaTUW4yz;

1.3
date	2016.12.15.07.47.08;	author kamil;	state Exp;
branches;
next	1.2;
commitid	B4vX2YxFr08Qj3yz;

1.2
date	2016.12.14.06.26.04;	author kamil;	state Exp;
branches;
next	1.1;
commitid	WAS229xPneQUTUxz;

1.1
date	2016.12.13.09.44.35;	author kamil;	state Exp;
branches;
next	;
commitid	eCAFlnoTyMC32Oxz;

1.29.2.1
date	2018.09.06.06.51.43;	author pgoyette;	state Exp;
branches;
next	;
commitid	HCi1bXD317XIK0RA;

1.29.4.1
date	2019.06.10.21.42.38;	author christos;	state Exp;
branches;
next	1.29.4.2;
commitid	jtc8rnCzWiEEHGqB;

1.29.4.2
date	2020.04.13.07.45.37;	author martin;	state Exp;
branches;
next	;
commitid	X01YhRUPVUDaec4C;

1.28.4.1
date	2018.04.12.13.42.49;	author martin;	state Exp;
branches;
next	;
commitid	V8a6bWK6bpwsL9yA;

1.11.2.1
date	2017.04.21.16.51.16;	author bouyer;	state Exp;
branches;
next	;
commitid	dUG7nkTKALCadqOz;

1.9.2.1
date	2016.12.31.20.57.15;	author pgoyette;	state dead;
branches;
next	1.9.2.2;
commitid	uEL0C1YuiJrlV0Bz;

1.9.2.2
date	2017.01.07.08.53.45;	author pgoyette;	state Exp;
branches;
next	1.9.2.3;
commitid	uEL0C1YuiJrlV0Bz;

1.9.2.3
date	2017.03.20.06.52.12;	author pgoyette;	state Exp;
branches;
next	1.9.2.4;
commitid	jjw7cAwgyKq7RfKz;

1.9.2.4
date	2017.04.26.02.52.18;	author pgoyette;	state Exp;
branches;
next	;
commitid	ojV02aOSdzvBqZOz;


desc
@@


1.33
log
@Drop TODO.ptrace

The remaining issues are mostly tracked in the ATF ptrace tests and GDB
or LLDB test-suite.
@
text
@$NetBSD: TODO.ptrace,v 1.32 2020/04/02 11:19:09 kamil Exp $

Items we (currently) plan to finish in the ptrace(2) field:

 - verify ppid of core dump generated with PT_DUMPCORE
   it must point to the real parent, not tracer
 - add PT_DUMPCORE tests in the ATF framework
 - research kgdb(4)

and of course: fix as many bugs as possible.

Features in ELF, DWARF, CTF, DTrace are out of scope of the above list.
@


1.32
log
@Update with reality

Drop finished or not important tasks.
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.31 2019/06/14 16:11:11 kamil Exp $
@


1.31
log
@Update TODO.ptrace

Drop compat32 entries as they were mostly addressed.
Drop MD specific calls, it's up to port's CPU to contain various features
like PT_STEP.
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.30 2018/08/05 13:07:33 kamil Exp $
a6 2
 - adapt OpenBSD regress test (regress/sys/ptrace/ptrace.c) for the ATF context
 - reiterate over FreeBSD tests and add missing ones if applicable
a7 7
 - research kevent support for tracing a process over a file descriptor,
   this means alternative to wait(2)-based events with passing events over the
   kqueue API - signal handlers are global per application and they clash with
   GUI toolkits (and perhaps other libraries) - this is long term wishlist in
   GDB for Linux - the current approach is to fork and debug through GDB remote
   protocol (this is how it is done in LLDB)
 - add ATF tests for SIGCHLD
@


1.30
log
@Update TODO.ptrace

Drop the following entries:
 - PaX MPROTECT tests - done, implemented.
 - research of ipkdb(4) - it's gone, if it will be superseded it would be
   probably a networking interface for kgdb
 - PTRACE_VFORK implemented and covered by tests, there are SMP bugs left
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.29 2017/08/28 00:46:07 kamil Exp $
a15 2
 - add support for PT_STEP, PT_GETREGS, PT_SETREGS, PT_GETFPREGS, PT_SETFPREGS
   in all ports
a16 1
 - fix more calls for netbsd32 compat
a17 1
 - check 64-bit debugger on 64-bit kernel tracing capabilities of 32-bit tracee
@


1.29
log
@Remove the filesystem tracing feature

This is a legacy interface from 4.4BSD, and it was
introduced to overcome shortcomings of ptrace(2) at that time, which are
no longer relevant (performance). Today /proc/#/ctl offers a narrow
subset of ptrace(2) commands and is not applicable for modern
applications use beyond simplistic tracing scenarios.

This removal will simplify kernel internals. Users will still be able to
use all the other /proc files.

This change won't affect other procfs files neither Linux compat
features within mount_procfs(8). /proc/#/ctl isn't available on Linux.

Remove:
 - /proc/#/ctl from mount_procfs(8)
 - P_FSTRACE note from the documentation of ps(1)
 - /proc/#/ctl and filesystem tracing documentation from mount_procfs(8)
 - KAUTH_REQ_PROCESS_PROCFS_CTL documentation from kauth(9)
 - source code file miscfs/procfs/procfs_ctl.c
 - PFSctl and procfs_doctl() from sys/miscfs/procfs/procfs.h
 - KAUTH_REQ_PROCESS_PROCFS_CTL from sys/sys/kauth.h
 - PSL_FSTRACE (0x00010000) from sys/sys/proc.h
 - P_FSTRACE (0x00010000) from sys/sys/sysctl.h

Reduce code complexity after removal of this functionality.

Update TODO.ptrace accordingly: remove two entries about /proc tracing.

Do not keep legacy notes as comments in the headers about removed
PSL_FSTRACE / P_FSTRACE, as this interface had little number of users
(close or equal to zero).

Proposed on tech-kern@@.

All filesystem tracing utility users are encouraged to switch to ptrace(2).

Sponsored by <The NetBSD Foundation>
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.28 2017/04/08 01:08:36 kamil Exp $
a9 1
 - add ATF tests for PT_WRITE_I and PIOD_WRITE_I - test mprotect restrictions
a17 1
 - add proper implementation of PTRACE_VFORK for vfork(2)-like events
a19 1
 - research ipkdb(4)
@


1.29.4.1
log
@Sync with HEAD
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.30 2018/08/05 13:07:33 kamil Exp $
d10 1
d19 1
d22 1
@


1.29.4.2
log
@Mostly merge changes from HEAD upto 20200411
@
text
@d1 1
a1 1
$NetBSD$
d7 2
d10 10
d21 1
@


1.29.2.1
log
@Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.30 2018/08/05 13:07:33 kamil Exp $
d10 1
d19 1
d22 1
@


1.28
log
@Update TODO.ptrace

Remove entries:
  - research support PT_SYSCALL & PT_STEP combined like in Linux
  - GDB Remote Protocol expects a case with a step with a signal to be sent,
    this is currently unsupported on NetBSD

Implemented as PT_SETSTEP and PT_CLEARSTEP.

Remove:
  - support QPassSignals (PT_SET_SIGPASS/PT_GET_SIGPASS) in the kernel, a way to
    stop routing a set of signals to tracer as they are uninteresting - GDB and
    LLDB expect this feature

This interface has been abandoned and will be handled on the debugger level.

Sponsored by <The NetBSD Foundation>
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.27 2017/03/03 07:11:49 kamil Exp $
a10 5
 - add tests for the procfs interface covering all functions available on the
   same level as ptrace(2)
 - remove 4.4BSD tracing with /proc, restrict /proc to Linux compat, to be
   superseded with kevent tracing, the original purpose of /proc debugging is
   long gone (performance issues with PT_WRITE_* and PT_READ_*)
@


1.28.4.1
log
@Pull up following revision(s) (requested by kamil in ticket #713):

	sys/modules/procfs/Makefile: revision 1.4
	sys/miscfs/procfs/procfs_vfsops.c: revision 1.98
	bin/ps/ps.1: revision 1.108
	sys/compat/linux/arch/i386/linux_ptrace.c: revision 1.32
	sys/miscfs/procfs/procfs_vnops.c: revision 1.198
	sys/kern/sys_ptrace_common.c: revision 1.23
	sys/kern/sys_ptrace_common.c: revision 1.24
	sbin/mount_procfs/mount_procfs.8: revision 1.36
	sys/kern/sys_ptrace_common.c: revision 1.25
	sys/kern/sys_ptrace.c: revision 1.5
	sys/compat/linux/arch/powerpc/linux_ptrace.c: revision 1.30
	sys/sys/proc.h: revision 1.342
	sys/kern/sys_ptrace_common.c: revision 1.26
	sys/miscfs/procfs/procfs_ctl.c: file removal
	sys/kern/sys_ptrace_common.c: revision 1.27
	sys/miscfs/procfs/procfs_subr.c: revision 1.109
	sys/kern/sys_ptrace_common.c: revision 1.28
	sys/secmodel/extensions/secmodel_extensions.c: revision 1.8
	sys/kern/sys_ptrace_common.c: revision 1.29
	sys/sys/ptrace.h: revision 1.62
	sys/compat/netbsd32/netbsd32_signal.c: revision 1.45
	share/man/man9/kauth.9: revision 1.109
	sys/miscfs/procfs/files.procfs: revision 1.12
	sys/compat/netbsd32/netbsd32.h: revision 1.115
	sys/miscfs/procfs/procfs.h: revision 1.72
	sys/compat/netbsd32/netbsd32_ptrace.c: revision 1.5
	sys/kern/kern_sig.c: revision 1.337
	sys/sys/kauth.h: revision 1.75
	sys/sys/sysctl.h: revision 1.224
	sys/kern/sys_ptrace_common.c: revision 1.30
	sys/kern/sys_ptrace_common.c: revision 1.31
	sys/kern/sys_ptrace_common.c: revision 1.32
	sys/kern/sys_ptrace_common.c: revision 1.33
	sys/compat/linux/arch/arm/linux_ptrace.c: revision 1.20
	sys/kern/sys_ptrace_common.c: revision 1.34
	sys/kern/sys_ptrace_common.c: revision 1.36
	sys/kern/kern_proc.c: revision 1.207
	sys/kern/kern_exit.c: revision 1.269
	doc/TODO.ptrace: revision 1.29

Make {s,g}et{db,fp,}regs work again for PK_32 processes
XXX: pullup-8

add disgusting magic to handle compat_netbsd32 as a module.

use process_*reg32 instead of struct *reg32.

Remove the filesystem tracing feature

This is a legacy interface from 4.4BSD, and it was
introduced to overcome shortcomings of ptrace(2) at that time, which are
no longer relevant (performance). Today /proc/#/ctl offers a narrow
subset of ptrace(2) commands and is not applicable for modern
applications use beyond simplistic tracing scenarios.

This removal will simplify kernel internals. Users will still be able to
use all the other /proc files.

This change won't affect other procfs files neither Linux compat
features within mount_procfs(8). /proc/#/ctl isn't available on Linux.

Remove:
 - /proc/#/ctl from mount_procfs(8)
 - P_FSTRACE note from the documentation of ps(1)
 - /proc/#/ctl and filesystem tracing documentation from mount_procfs(8)
 - KAUTH_REQ_PROCESS_PROCFS_CTL documentation from kauth(9)
 - source code file miscfs/procfs/procfs_ctl.c
 - PFSctl and procfs_doctl() from sys/miscfs/procfs/procfs.h
 - KAUTH_REQ_PROCESS_PROCFS_CTL from sys/sys/kauth.h
 - PSL_FSTRACE (0x00010000) from sys/sys/proc.h
 - P_FSTRACE (0x00010000) from sys/sys/sysctl.h

Reduce code complexity after removal of this functionality.

Update TODO.ptrace accordingly: remove two entries about /proc tracing.

Do not keep legacy notes as comments in the headers about removed

PSL_FSTRACE / P_FSTRACE, as this interface had little number of users
(close or equal to zero).
Proposed on tech-kern@@.

All filesystem tracing utility users are encouraged to switch to ptrace(2).

Sponsored by <The NetBSD Foundation>

untangle the mess:
- factor out common code
- break each ptrace subcall to its own sub-function
  .. more to come ...
- reduce ifdef ugliness by moving it up top.
- factor out PT_IO and make PT_{READ,WRITE}_{I,D} use it
- factor out PT_DUMPCORE
- factor out sendsig code
  .. more to come ...

handle siginfo requests for ptrace32

ptrace: Partially undo PT_{READ,WRITE}_{I,D} and unbreak these commands

The refactored code did not work and was generating EFAULT.

Sponsored by <The NetBSD Foundation>

Merge the code back; the problem was that since we are reading/writing
to a kernel address for PT_{READ,WRITE}_{I,D} we need the kernel vmspace.
provide separate read and write functions to accomodate register functions
that need a size argument.

don't ignore error from copyout_piod

Use the proper process (the tracee) to get information about lwps and
registers and the tracer for vmspace.

Add new sysctl(3) entry: security.models.extensions.user_set_dbregs

Model this new sysctl(3) entry after "user_set_cpu_affinity" in the same
level of sysctl(3) switches.

Allow to read unconditionally Debug Registers (no change here). This is
convenient as even if a user of a debugger does not use hardware assisted
watchpoints/breakpoints, a debugger can still prompt these values to store
in an internal cache with context of registers. Reading them should have
no security concerns.

Add a paranoid MI switch that prohibits by default setting these registers
by a regular user (non-superuser). Make this switch disabled by default.
There are enough reserved bits out there to allow using them
unconditionally on hardened hosts.

Features shipped with Debug Registers are optional features in debuggers.
There is no reduction in elementary functionality.

Reviewed by <christos>

Sponsored by <The NetBSD Foundation>
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.28 2017/04/08 01:08:36 kamil Exp $
d11 5
@


1.27
log
@TODO.ptrace: Remove entry about addition of TRAP_SCE and TRAP_SCX

These siginfo(2) codes have been committed.
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.26 2017/03/03 07:03:11 kamil Exp $
a25 1
 - research support PT_SYSCALL & PT_STEP combined like in Linux
a29 5
 - GDB Remote Protocol expects a case with a step with a signal to be sent,
   this is currently unsupported on NetBSD
 - support QPassSignals (PT_SET_SIGPASS/PT_GET_SIGPASS) in the kernel, a way to
   stop routing a set of signals to tracer as they are uninteresting - GDB and
   LLDB expect this feature
@


1.26
log
@Add new entry in TODO.ptrace about QPassSignals

Added:
   support QPassSignals (PT_SET_SIGPASS/PT_GET_SIGPASS) in the kernel, a way to
   stop routing a set of signals to tracer as they are uninteresting - GDB and
   LLDB expect this feature
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.25 2017/03/02 14:25:41 kamil Exp $
a25 1
 - add si_code values for PT_SYSCALL: TRAP_SCE and TRAP_SCX
@


1.25
log
@Add new entry in TODO.ptrace about PT_STEP with a signal

Added:
  GDB Remote Protocol expects a case with a step with a signal to be sent,
  this is currently unsupported on NetBSD
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.24 2017/02/28 13:10:54 kamil Exp $
d34 3
@


1.24
log
@Sync TODO.ptrace with reality

Remove entries:
- add new ptrace(2) calls to lock (suspend) and unlock LWP within a process
- switch PT_WATCHPOINT* to PT_*ETDBREGS and document it, add ATF tests
- add ATF tests for PT_SYSCALL and PT_SYSCALLEMU

Sponsored by <The NetBSD Foundation>
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.23 2017/02/20 03:37:24 kamil Exp $
d32 2
@


1.23
log
@Add new entry to TODO.ptrace

check 64-bit debugger on 64-bit kernel tracing capabilities of 32-bit tracee

Sponsored by <The NetBSD Foundation>
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.22 2017/02/17 21:22:02 kamil Exp $
a8 1
 - add new ptrace(2) calls to lock (suspend) and unlock LWP within a process
a10 1
 - switch PT_WATCHPOINT* to PT_*ETDBREGS and document it, add ATF tests
a26 1
 - add ATF tests for PT_SYSCALL and PT_SYSCALLEMU
@


1.22
log
@Add new entry in TODO.ptrace

Research kgdb. It should be supported by GDB and LLDB.

Sponsored by <The NetBSD Foundation>
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.21 2017/02/14 18:38:07 kamil Exp $
d34 1
@


1.21
log
@Add new entry to TODO.ptrace

research ipkdb(4)

Sponsored by <The NetBSD Foundation>
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.20 2017/02/13 15:29:18 kamil Exp $
d33 1
@


1.20
log
@Update TODO.ptrace

Note BSD4.4-like /proc debugging removal
Explain kevent(2)-based debugging proposal

Sponsored by <The NetBSD Foundation>
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.19 2017/02/12 06:16:33 kamil Exp $
d32 1
@


1.19
log
@Update TODO.ptrace

Remove:
 - add PT_SET_SIGMASK and PT_GET_SIGMASK - used by checkpointing software

This interface has been committed to HEAD.

Sponsored by <The NetBSD Foundation>
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.18 2017/02/12 05:21:34 kamil Exp $
d15 9
a23 3
 - add support to read debugger events via a file descriptor in procfs
   (kevent(2)), it's still useful in cases when a parent traces tracee and has
   to call waitpid(2) for its child - as this clashes with GUI toolkits
@


1.18
log
@Update TODO.ptrace with new entries

Added entries:
 - add support to read debugger events via a file descriptor in procfs
   (kevent(2)), it's still useful in cases when a parent traces tracee and has
   to call waitpid(2) for its child - as this clashes with GUI toolkits
 - fix more calls for netbsd32 compat

Sponsored by <The NetBSD Foundation>
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.17 2017/02/11 19:10:04 kamil Exp $
a23 1
 - add PT_SET_SIGMASK and PT_GET_SIGMASK - used by checkpointing software
@


1.17
log
@Update TODO.ptrace

Remove entries:
 - remove exect(3) from libc - there is no usecase for it

Interface has been marked obsolete and it's on the queue to be removed for.

 - research what happens when a tracee masks signals (including SIGTRAP) and a
   breakpoint is triggered

It has been researched and ATF tests added (signal1 .. signal10).
It's currently broken on NetBSD.

Add:
 - research support PT_SYSCALL & PT_STEP combined like in Linux

There are circumstances when we want to sstep and catch syscall events.

Sponsored by <The NetBSD Foundation>
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.16 2017/02/08 14:53:50 kamil Exp $
d15 3
d26 1
@


1.16
log
@Add new entry in TODO.ptrace

Added:
    add PT_SET_SIGMASK and PT_GET_SIGMASK - used by checkpointing software

Example software: gdb, criu
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.15 2017/02/08 03:44:41 kamil Exp $
a17 3
 - remove exect(3) from libc - there is no usecase for it
 - research what happens when a tracee masks signals (including SIGTRAP) and a
   breakpoint is triggered
d22 1
@


1.15
log
@libpthread_dbg(3) deletion from the base distribution

libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.14 2017/02/07 16:15:05 kamil Exp $
d24 1
@


1.14
log
@Update TODO.ptrace

Note PT_WATCHPOINT change to PT_*ETDBREGS.
Remove GDB and LLDB related entries from generic ptrace(2) TODO.
Note need for TRAP_SCE and TRAP_SCX si_codes in PT_SYSCALL*.
Note removal request of pthread_dbg(3).

Sponsord by <The NetBSD Foundation>
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.13 2017/01/26 01:12:13 kamil Exp $
a18 1
 - remove pthread_dbg(3) from the base distribution
@


1.13
log
@Update TODO.ptrace

Added:
 - reiterate over FreeBSD tests and add missing ones if applicable

Sponsored by <The NetBSD Foundation>
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.12 2017/01/26 01:04:23 kamil Exp $
d12 1
a12 1
 - once the API for hardware watchpoints will stabilize, document it
a16 2
 - integrate all ptrace(2) features in gdb
 - add ptrace(2) NetBSD support in LLDB
d18 2
a19 3
 - remove exect(3) - there is no usecase for it
 - refactor pthread_dbg(3) to only query private pthread_t data, otherwise it
   duplicates ptrace(2) interface and cannot cover all types of threads
d23 1
@


1.12
log
@Update TODO.ptrace

Drop:
 - add ATF tests for PIOD_READ_AUXV

Add new entry:
 - research what happens when a tracee masks signals (including SIGTRAP)
   and a breakpoint is triggered

Sponsored by <The NetBSD Foundation>
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.11 2017/01/14 01:36:28 kamil Exp $
d8 1
@


1.11
log
@Update TODO.ptrace

Removed:
  - evaluate equivalent for PTRACE_O_TRACECLONE from Linux

clone(2)-like calls are traced with PTRACE_FORK, PTRACE_VFORK and
PTRACE_VFORK_DONE. VFORK ones block parent till termination or execve(2) of
its child.

Added:
  - add proper implementation of PTRACE_VFORK for vfork(2)-like events

Currently PTRACE_VFORK is a stub.

Sponsored by <The NetBSD Foundation>
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.10 2017/01/08 04:27:36 kamil Exp $
a10 1
 - add ATF tests for PIOD_READ_AUXV
d22 2
@


1.11.2.1
log
@Sync with HEAD
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.28 2017/04/08 01:08:36 kamil Exp $
d8 1
a8 1
 - reiterate over FreeBSD tests and add missing ones if applicable
d11 2
a14 9
 - remove 4.4BSD tracing with /proc, restrict /proc to Linux compat, to be
   superseded with kevent tracing, the original purpose of /proc debugging is
   long gone (performance issues with PT_WRITE_* and PT_READ_*)
 - research kevent support for tracing a process over a file descriptor,
   this means alternative to wait(2)-based events with passing events over the
   kqueue API - signal handlers are global per application and they clash with
   GUI toolkits (and perhaps other libraries) - this is long term wishlist in
   GDB for Linux - the current approach is to fork and debug through GDB remote
   protocol (this is how it is done in LLDB)
d17 2
d20 3
d24 1
a24 4
 - fix more calls for netbsd32 compat
 - research ipkdb(4)
 - research kgdb(4)
 - check 64-bit debugger on 64-bit kernel tracing capabilities of 32-bit tracee
@


1.10
log
@Update TODO.ptrace

1. siginfo_t accessors done
2. PTRACE_O_TRACEEXIT not applicable for NetBSD as we are tracing the whole
process at once, not per thread
3. PTRACE_O_TRACEEXEC implemented as SIGTRAP & TRAP_EXEC

Sponsored by <The NetBSD Foundation>
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.9 2016/12/31 20:57:15 kamil Exp $
d19 1
a19 1
 - evaluate equivalent for PTRACE_O_TRACECLONE from Linux
@


1.9
log
@Update TODO.ptrace

Mark exect(3) for removal, there is no use-case for it. exec() is already
monitored and emits SIGTRAP when traced.

Accessor for siginfo_t is not case for PT_IO -- it's not reading/writing
process space of other process, but shared kernel space.
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.8 2016/12/26 08:43:55 kamil Exp $
d19 1
a19 2
 - add support for detecting equivalent events to PTRACE_O_TRACEEXEC,
   PTRACE_O_TRACECLONE, PTRACE_O_TRACEEXIT from Linux
a24 1
 - add support to read and write siginfo_t from and to tracee
@


1.9.2.1
log
@file TODO.ptrace was added on branch pgoyette-localcount on 2017-01-07 08:53:45 +0000
@
text
@d1 30
@


1.9.2.2
log
@Sync with HEAD.  (Note that most of these changes are simply $NetBSD$
tag issues.)
@
text
@a0 30
$NetBSD: TODO.ptrace,v 1.9 2016/12/31 20:57:15 kamil Exp $

Items we (currently) plan to finish in the ptrace(2) field:

 - verify ppid of core dump generated with PT_DUMPCORE
   it must point to the real parent, not tracer
 - adapt OpenBSD regress test (regress/sys/ptrace/ptrace.c) for the ATF context
 - add new ptrace(2) calls to lock (suspend) and unlock LWP within a process
 - add PT_DUMPCORE tests in the ATF framework
 - add ATF tests for PT_WRITE_I and PIOD_WRITE_I - test mprotect restrictions
 - add ATF tests for PIOD_READ_AUXV
 - once the API for hardware watchpoints will stabilize, document it
 - add tests for the procfs interface covering all functions available on the
   same level as ptrace(2)
 - add support for PT_STEP, PT_GETREGS, PT_SETREGS, PT_GETFPREGS, PT_SETFPREGS
   in all ports
 - integrate all ptrace(2) features in gdb
 - add ptrace(2) NetBSD support in LLDB
 - add support for detecting equivalent events to PTRACE_O_TRACEEXEC,
   PTRACE_O_TRACECLONE, PTRACE_O_TRACEEXIT from Linux
 - remove exect(3) - there is no usecase for it
 - refactor pthread_dbg(3) to only query private pthread_t data, otherwise it
   duplicates ptrace(2) interface and cannot cover all types of threads
 - add ATF tests for SIGCHLD
 - add ATF tests for PT_SYSCALL and PT_SYSCALLEMU
 - add support to read and write siginfo_t from and to tracee

and of course: fix as many bugs as possible.

Features in ELF, DWARF, CTF, DTrace are out of scope of the above list.
@


1.9.2.3
log
@Sync with HEAD
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.27 2017/03/03 07:11:49 kamil Exp $
d8 1
a8 1
 - reiterate over FreeBSD tests and add missing ones if applicable
d11 2
a14 9
 - remove 4.4BSD tracing with /proc, restrict /proc to Linux compat, to be
   superseded with kevent tracing, the original purpose of /proc debugging is
   long gone (performance issues with PT_WRITE_* and PT_READ_*)
 - research kevent support for tracing a process over a file descriptor,
   this means alternative to wait(2)-based events with passing events over the
   kqueue API - signal handlers are global per application and they clash with
   GUI toolkits (and perhaps other libraries) - this is long term wishlist in
   GDB for Linux - the current approach is to fork and debug through GDB remote
   protocol (this is how it is done in LLDB)
d17 7
a23 1
 - add proper implementation of PTRACE_VFORK for vfork(2)-like events
d25 2
a26 10
 - research support PT_SYSCALL & PT_STEP combined like in Linux
 - fix more calls for netbsd32 compat
 - research ipkdb(4)
 - research kgdb(4)
 - check 64-bit debugger on 64-bit kernel tracing capabilities of 32-bit tracee
 - GDB Remote Protocol expects a case with a step with a signal to be sent,
   this is currently unsupported on NetBSD
 - support QPassSignals (PT_SET_SIGPASS/PT_GET_SIGPASS) in the kernel, a way to
   stop routing a set of signals to tracer as they are uninteresting - GDB and
   LLDB expect this feature
@


1.9.2.4
log
@Sync with HEAD
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.28 2017/04/08 01:08:36 kamil Exp $
d26 1
d31 5
@


1.8
log
@Add new entry in TODO.ptrace

 + add support to read and write siginfo_t from and to tracee (reuse PT_IO?)

Sponsored by <The NetBSD Foundation>
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.7 2016/12/26 03:24:11 kamil Exp $
d21 1
a21 1
 - exect(3) rethink or remove -- maybe PT_TRACE_ME + PTRACE_O_TRACEEXEC?
d26 1
a26 1
 - add support to read and write siginfo_t from and to tracee (reuse PT_IO?)
@


1.7
log
@Add new entry in TODO.ptrace

 + add ATF tests for PT_SYSCALL and PT_SYSCALLEMU

Sponsored by <The NetBSD Foundation>
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.6 2016/12/24 05:43:31 kamil Exp $
d25 2
a26 1
 - add ATF tsts for PT_SYSCALL and PT_SYSCALLEMU
@


1.6
log
@Add new entry in TODO.ptrace

New entry:
 - add ATF tests for SIGCHLD
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.5 2016/12/19 03:19:37 kamil Exp $
d21 1
a21 1
 - exect(3) rething or remove -- maybe PT_TRACE_ME + PTRACE_O_TRACEEXEC?
d25 1
@


1.5
log
@TODO.ptrace: Update notes about MD documentation

Currently all the MD interfaces are documented, remove this line from TODO.
Add new note:
    once the API for hardware watchpoints will stabilize, document it

Sponsored by <The NetBSD Foundation>
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.4 2016/12/15 12:42:38 kamil Exp $
d24 1
@


1.4
log
@Update TODO.ptrace with recent changes

Hardware assisted breakpoint/watchpoint API has been merged with current.

Add note about pthread_dbg(3) API needed to be refactored and limited to
querying POSIX thread private data fields.

Sponsored by <The NetBSD Foundation>
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.3 2016/12/15 07:47:08 kamil Exp $
d12 1
a12 2
 - document all MD specific ptrace(2) interfaces
   (PT_GETXMMREGS, PT_SETXMMREGS, ...)
@


1.3
log
@Add new entries to TODO.ptrace

 - add support for detecting equivalent events to PTRACE_O_TRACEEXEC,
   PTRACE_O_TRACECLONE, PTRACE_O_TRACEEXIT from Linux
 - exect(3) rething or remove -- maybe PT_TRACE_ME + PTRACE_O_TRACEEXEC?

Sponsored by <The NetBSD Foundation>
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.2 2016/12/14 06:26:04 kamil Exp $
a4 1
 - merge hardware watchpoint (breakpoint) support with HEAD
d23 2
a24 1
   
@


1.2
log
@Update TODO.ptrace

Add new entries:
 - add support for PT_STEP, PT_GETREGS, PT_SETREGS, PT_GETFPREGS,
   PT_SETFPREGS in all ports
 - integrate all ptrace(2) features in gdb
 - add ptrace(2) NetBSD support in LLDB

Sponsored by <The NetBSD Foundation>
@
text
@d1 1
a1 1
$NetBSD: TODO.ptrace,v 1.1 2016/12/13 09:44:35 kamil Exp $
d21 4
@


1.1
log
@Add initial TODO list for the ptrace(2) (and procfs) interface.

Sponsored by <The NetBSD Foundation>
@
text
@d1 1
a1 1
$NetBSD: TODO.8,v 1.5 2016/10/26 20:05:11 christos Exp $
d13 1
a13 1
 - document more all MD specific ptrace(2) interfaces
d17 4
@

