From owner-freebsd-hackers Thu Feb 6 10:50:34 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D9F5337B401 for ; Thu, 6 Feb 2003 10:50:32 -0800 (PST) Received: from sccrmhc01.attbi.com (sccrmhc01.attbi.com [204.127.202.61]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4ED0143FD7 for ; Thu, 6 Feb 2003 10:50:32 -0800 (PST) (envelope-from julian@elischer.org) Received: from interjet.elischer.org (12-232-168-4.client.attbi.com[12.232.168.4]) by sccrmhc01.attbi.com (sccrmhc01) with ESMTP id <2003020618503000100g1g47e>; Thu, 6 Feb 2003 18:50:31 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id KAA08537; Thu, 6 Feb 2003 10:50:30 -0800 (PST) Message-Id: <200302061850.KAA08537@InterJet.elischer.org> Date: Thu, 6 Feb 2003 10:50:28 -0800 (PST) From: Julian Elischer To: Dag-Erling Smorgrav Cc: Andrey Simonenko , freebsd-hackers@freebsd.org Subject: Re: Help with understanding process state, context switching and Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG signals In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII The only way it makes sense to talk about suspending a process in user space from the kernel, would be in a MP system. in a UP system, if you are in the kernel, then there is no process in user space. (it trapped into the kernel whenever whatever interrupt that stasrted you running happenned). In SMP you may need to set some flag and send an IP to all teh processes to ensure that the process enters the kernel to see the flag. Depending on what you wnat to do, it is possible that ptrace (as DES says) is what you want, or maybe just a SIGSTOP will do. On Thu, 6 Feb 2003, Dag-Erling Smorgrav wrote: > Andrey Simonenko writes: > > In short: I need to stop (suspend) some process from the kernel, when > > that process is in user mode and get information about its general-purpose > > registers, its VM structures, etc. > > Have you looked at ptrace(2)? That's what gdb(1) uses. You can get > additional information about memory maps etc. from procfs. > > DES > -- > Dag-Erling Smorgrav - des@ofug.org > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message