Re-apply r248644. This fixes an annoying problem which caused dtrace -c to

fail to attach to stripped binaries. With the _r_debug_postinit symbol,
dtrace(1) can now set a breakpoint in the victim process after it has
registered its DOF table(s) with the kernel. r_debug_state cannot be used
for this purpose since it is called before DOF is made available, in which
case dtrace(1) cannot create USDT probes before the program begins
execution.

MFC after:	2 weeks
This commit is contained in:
Mark Johnston 2014-05-08 03:43:18 +00:00
parent 59c56d6c6f
commit f0736f4cec
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=265631

View File

@ -1138,7 +1138,7 @@ dt_vopen(int version, int flags, int *errp,
#if defined(sun)
dtp->dt_prcmode = DT_PROC_STOP_PREINIT;
#else
dtp->dt_prcmode = DT_PROC_STOP_MAIN;
dtp->dt_prcmode = DT_PROC_STOP_POSTINIT;
#endif
dtp->dt_linkmode = DT_LINK_KERNEL;
dtp->dt_linktype = DT_LTYP_ELF;