From owner-freebsd-arch Fri Dec 14 15:23:29 2001 Delivered-To: freebsd-arch@freebsd.org Received: from po4.wam.umd.edu (po4.wam.umd.edu [128.8.10.166]) by hub.freebsd.org (Postfix) with ESMTP id 86D2F37B41A for ; Fri, 14 Dec 2001 15:23:24 -0800 (PST) Received: from rac1.wam.umd.edu (IDENT:root@rac1.wam.umd.edu [128.8.10.141]) by po4.wam.umd.edu (8.9.3/8.9.3) with ESMTP id SAA06706; Fri, 14 Dec 2001 18:23:20 -0500 (EST) Received: from rac1.wam.umd.edu (IDENT:sendmail@localhost [127.0.0.1]) by rac1.wam.umd.edu (8.9.3/8.9.3) with SMTP id SAA04482; Fri, 14 Dec 2001 18:23:18 -0500 (EST) Received: from localhost (culverk@localhost) by rac1.wam.umd.edu (8.9.3/8.9.3) with ESMTP id SAA04478; Fri, 14 Dec 2001 18:23:18 -0500 (EST) X-Authentication-Warning: rac1.wam.umd.edu: culverk owned process doing -bs Date: Fri, 14 Dec 2001 18:23:18 -0500 (EST) From: Kenneth Wayne Culver To: Julian Elischer Cc: arch@FreeBSD.ORG Subject: Re: KSEs and PTRACE/PROCFS In-Reply-To: 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 I don't know how to do this, but would it be possible to allow a user to somehow pick a thread if he/she wanted to? That would be most useful... Ken On Fri, 14 Dec 2001, Julian Elischer wrote: > 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 > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message