Deleted Added
full compact
91a92,97
> #if !defined(sun)
> #include <sys/syscall.h>
> #include <libproc_compat.h>
> #define SYS_forksys SYS_fork
> #endif
>
95d100
< #ifdef DOODAD
117d121
< #endif
122d125
< #if defined(sun)
124,126d126
< #else
< int state = proc_state(dpr->dpr_proc);
< #endif
132,133d131
< printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
< #ifdef DOODAD
139d136
< #endif
146d142
< #ifdef DOODAD
149a146
> #if defined(sun)
150a148,150
> #else
> unsigned long pc;
> #endif
154a155,159
> #if !defined(sun)
> proc_regget(dpr->dpr_proc, REG_PC, &pc);
> proc_bkptregadj(&pc);
> #endif
>
156a162
> #if defined(sun)
158a165,168
> #else
> if (pc == dbp->dbp_addr)
> break;
> #endif
162a173
> #if defined(sun)
163a175,177
> #else
> (int)dpr->dpr_pid, pc);
> #endif
173d186
< #endif
184,185d196
< printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
< #ifdef DOODAD
189d199
< #endif
204,205d213
< printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
< #ifdef DOODAD
209d216
< #endif
282d288
< #if defined(sun)
338a345
> #if defined(sun)
339a347,350
> #else
> /* XXX ugly */
> (dt_bkpt_f *)dt_proc_rdevent, __DECONST(void *, evname));
> #endif
348a360
> #if defined(sun)
349a362
> #endif
355a369
> #if defined(sun)
357a372
> #endif
359a375
> #if defined(sun)
360a377
> #endif
362d378
<
364a381
> #if defined(sun)
365a383
> #endif
366a385
> #if defined(sun)
367a387
> #endif
408a429,430
> printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
> #ifdef DOODAD
458d479
< }
459a481
> }
535a558
> #endif
541a565
> #if defined(sun)
542a567,569
> #else
> if (proc_getflags(P) & PR_KLC)
> #endif
551,559d577
< #else
< /*
< * If PR_KLC is set, we created the process; otherwise we grabbed it.
< * Check for an appropriate stop request and wait for dt_proc_continue.
< */
< if (proc_getflags(P) & PR_KLC)
< dt_proc_stop(dpr, DT_PROC_STOP_CREATE);
< else
< dt_proc_stop(dpr, DT_PROC_STOP_GRAB);
561,565d578
< if (proc_continue(P) != 0)
< dt_dprintf("pid %d: failed to set running: %s\n",
< (int)dpr->dpr_pid, strerror(errno));
< #endif
<
578d590
< #if defined(sun)
580a593
> #if defined(sun)
585a599,600
> if (errno == EINTR)
> continue; /* check dpr_quit and continue waiting */
598d612
< #if defined(sun)
600,602d613
< #else
< switch (proc_state(P)) {
< #endif
604c615
< #ifdef DOODAD
---
> #if defined(sun)
605a617,619
> #else
> psp = proc_getlwpstatus(P);
> #endif
647d660
< #endif
670d682
< #if defined(sun)
675d686
< #endif
715d725
< #if defined(sun)
717,719d726
< #else
< proc_detach(dpr->dpr_proc, 0);
< #endif
807c814
< (void) pthread_kill(dpr->dpr_tid, SIGUSR1);
---
> pthread_kill(dpr->dpr_tid, SIGUSR1);
856d862
< #if defined(sun)
858,860d863
< #else
< proc_detach(dpr->dpr_proc, rflag);
< #endif
915d917
< #endif
917,919d918
<
< #if defined(sun)
< if (Pstate(dpr->dpr_proc) == PS_LOST) {
921c920,921
< if (proc_state(dpr->dpr_proc) == PS_LOST) {
---
> int stat = proc_getwstat(dpr->dpr_proc);
> int pid = proc_getpid(dpr->dpr_proc);
922a923
> if (proc_state(dpr->dpr_proc) == PS_LOST) {
926d926
< #if defined(sun)
935d934
< #endif
967a967,970
> #else
> if ((err = proc_create(file, argv, pcf, child_arg,
> &dpr->dpr_proc)) != 0) {
> #endif
972a976
> #if defined(sun)
974,976d977
<
< (void) Punsetflags(dpr->dpr_proc, PR_RLC);
< (void) Psetflags(dpr->dpr_proc, PR_KLC);
978,983d978
< (void) proc_clearflags(dpr->dpr_proc, PR_RLC);
< (void) proc_setflags(dpr->dpr_proc, PR_KLC);
< if ((err = proc_create(file, argv, pcf, child_arg, &dpr->dpr_proc)) != 0)
< return (dt_proc_error(dtp, dpr,
< "failed to execute %s: %s\n", file, strerror(err)));
< dpr->dpr_hdl = dtp;
987c982,984
< #if defined(sun)
---
> (void) Punsetflags(dpr->dpr_proc, PR_RLC);
> (void) Psetflags(dpr->dpr_proc, PR_KLC);
>
989,991d985
< #else
< if (dt_proc_create_thread(dtp, dpr, DT_PROC_STOP_IDLE) != 0)
< #endif
1048a1043,1045
> #else
> if ((err = proc_attach(pid, flags, &dpr->dpr_proc)) != 0) {
> #endif
1052,1056d1048
< #else
< if ((err = proc_attach(pid, flags, &dpr->dpr_proc)) != 0)
< return (dt_proc_error(dtp, dpr,
< "failed to grab pid %d: %s\n", (int) pid, strerror(err)));
< #endif
1061d1052
< #if defined(sun)
1064,1067d1054
< #else
< (void) proc_clearflags(dpr->dpr_proc, PR_KLC);
< (void) proc_setflags(dpr->dpr_proc, PR_RLC);
< #endif
1188c1175
< if (P != NULL && idp != NULL && idp->di_id == 0)
---
> if (P != NULL && idp != NULL && idp->di_id == 0) {
1193a1181
> }