Date: Fri, 14 Dec 2001 18:23:18 -0500 (EST) From: Kenneth Wayne Culver <culverk@wam.umd.edu> To: Julian Elischer <julian@elischer.org> Cc: arch@FreeBSD.ORG Subject: Re: KSEs and PTRACE/PROCFS Message-ID: <Pine.GSO.4.21.0112141822540.3906-100000@rac1.wam.umd.edu> In-Reply-To: <Pine.BSF.4.21.0112141306510.17119-100000@InterJet.elischer.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.21.0112141822540.3906-100000>
