From owner-freebsd-questions@FreeBSD.ORG Thu Sep 13 20:23:36 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3CFE16A41A for ; Thu, 13 Sep 2007 20:23:35 +0000 (UTC) (envelope-from buganini@gmail.com) Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.191]) by mx1.freebsd.org (Postfix) with ESMTP id B72C813C474 for ; Thu, 13 Sep 2007 20:23:35 +0000 (UTC) (envelope-from buganini@gmail.com) Received: by rv-out-0910.google.com with SMTP id l15so438002rvb for ; Thu, 13 Sep 2007 13:23:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=bDQt7iA0cUMv/TnQMVyvXM76JGibOwWvEh68rfOUDTg=; b=riKSw+gh5O1SbtV/+fDaNpf+pBmMc2ZoYkkP1pDdXr7bNLkEDriI9W9d3rnMKxxgGwkvffIOO/wiXajBEDGQsSHw/7NGYyA/i5He7FPABaAQiDhgZtPHABUVX/jr+12DIuLlTcJNxyXwk0xHLNBmUrpOWw+Sx5Ojo2wd0BQBSo4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=gcBSWvhsRueFvp2Jo0WnWUamnpeywxeNrmwpWnt8CDyRgU3h8fy1CGgDDsO11gf4WO41OxgTqNpA2HE2eOvu40kr5XSf7Yqw+475hfnI/rfVebpUXSiu5jFXGdsIneQSpen7MQ6p6jKZu1fS1TNoz0qABzW8JOFNyQLjdX1FuXE= Received: by 10.141.115.6 with SMTP id s6mr79308rvm.1189715013626; Thu, 13 Sep 2007 13:23:33 -0700 (PDT) Received: by 10.141.33.2 with HTTP; Thu, 13 Sep 2007 13:23:33 -0700 (PDT) Message-ID: Date: Fri, 14 Sep 2007 04:23:33 +0800 From: Buganini To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Getting vm_map of a ptraced process X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Sep 2007 20:23:36 -0000 I want to get vm_map of a ptraced process, but process structure is prerequisite to getting vm_map How can I get the process structure? I saw FOREACH_THREAD_IN_PROC in the source, but this need superuser's power, right? Is PT_READ from memory a good way? (seems to be dirty) Or this way? (not bad, I think, but not yet standard) http://www.e.kth.se/~lha/patches/netbsd/gdb-core/ptrace-patch any better idea is welcome, thanks -Buganini