Beispiel #1
0
bool wind_set_target (WindCtx *ctx, uint32_t pid) {
	WindProc *p;
	RListIter *it;
	if (pid) {
		RList *l = wind_list_process (ctx);
		r_list_foreach (l, it, p) {
			if (p->uniqueid == pid) {
				ctx->target = p;
				return true;
			}
		}
		return false;
	}
	ctx->target = NULL;
	return true;
}
Beispiel #2
0
static RList *r_debug_wind_pids (int pid) {
    RList *ret, *pids;
    RListIter *it;
    WindProc *p;

    ret = r_list_newf (free);
    if (!ret) return NULL;

    pids = wind_list_process(wctx);
    if (!pids)
        return ret;

    r_list_foreach(pids, it, p) {
        RDebugPid *newpid = R_NEW0 (RDebugPid);
        newpid->path = strdup (p->name);
        newpid->pid = p->uniqueid;
        newpid->status = 's';
        newpid->runnable = R_TRUE;
        r_list_append (ret, newpid);
    }