From owner-freebsd-arch Fri Dec 14 13:21:10 2001 Delivered-To: freebsd-arch@freebsd.org Received: from rwcrmhc53.attbi.com (rwcrmhc53.attbi.com [204.127.198.39]) by hub.freebsd.org (Postfix) with ESMTP id 51D9237B431 for ; Fri, 14 Dec 2001 13:20:14 -0800 (PST) Received: from InterJet.elischer.org ([12.232.206.8]) by rwcrmhc53.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20011214212008.LIL10701.rwcrmhc53.attbi.com@InterJet.elischer.org> for ; Fri, 14 Dec 2001 21:20:08 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id NAA22211 for ; Fri, 14 Dec 2001 13:17:20 -0800 (PST) Date: Fri, 14 Dec 2001 13:17:18 -0800 (PST) From: Julian Elischer To: arch@freebsd.org Subject: KSEs and PTRACE/PROCFS Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Is there someone who really understands these, and who feels that they have a good idea of what the behaviour of a multi-threaded process should be when ptraced? The question is: WHat does it mean to "single step" a process with several threads? WHen you suspend a process, what happens? If there is someone with feelings on these topics I whuold welcome your input. Here's a brief example: case PT_STEP: case PT_CONTINUE: case PT_DETACH: if ((uap->req != PT_STEP) && ((unsigned)uap->data >= NSIG)) return (EINVAL); PHOLD(p); if (uap->req == PT_STEP) { if ((error = ptrace_single_step(FIRST_THREAD_IN_PROC(p))) { PRELE(p); return (error); } } if (uap->addr != (caddr_t)1) { fill_kinfo_proc(p, &p->p_uarea->u_kproc); if ((error = ptrace_set_pc( FIRST_THREAD_IN_PROC(p), (u_long)(uintfptr_t)uap->addr))) { PRELE(p); return (error); } } PRELE(p); In this code in the "ptrace" function, we use FIRST_THREAD_IN_PROC() which returns tgeh only thread in a normal system but if there are many threads active in the process, what should we do? Should we set asside one thread and KSE to run all work, thus serialising everything? if so where do we store it, and how do we separate it from all the other threads? Should we pick threads at random? If you are a debugger afficionado, I'd lov eto hear your ideas on this, julian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message