From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 20 00:52:32 2007 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0554F16A418 for ; Fri, 20 Jul 2007 00:52:32 +0000 (UTC) (envelope-from ioplex@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.225]) by mx1.freebsd.org (Postfix) with ESMTP id B82D113C44C for ; Fri, 20 Jul 2007 00:52:31 +0000 (UTC) (envelope-from ioplex@gmail.com) Received: by wx-out-0506.google.com with SMTP id i29so595845wxd for ; Thu, 19 Jul 2007 17:52:31 -0700 (PDT) DKIM-Signature: a=rsa-sha1; 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; b=QNEGsk7GICdfsnG55enyGw5AGo0awFqgcQIh0dZMAOlpGlQxdPbL9jPWsDP2BY0C294A/DivimyHQV4Sw8Av7SQsuV39zBHJJ6UVJVrOSgfz4WXXl7HR9uryfTlUuY34KqDkcoUDsdgP5gpKd8S9QvO9XfoAo/0WPAZhLmui6HQ= 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=oPs9UOyApiG4fxCRA6cNogCPpxn3C9MMf72byghtES3BsWEbvcEuvwWN4LYK7LZQlH+twkZ+kX2M990O8YkEouJkpNP+7A42OlBfA+D33Yjnl0AmmQVT9CsEf07S6VULl6ONqhLmMqKx2b/LN/jOsS3inOKwhrvq6OD14RFDdl0= Received: by 10.70.96.3 with SMTP id t3mr3678698wxb.1184891127220; Thu, 19 Jul 2007 17:25:27 -0700 (PDT) Received: by 10.70.38.11 with HTTP; Thu, 19 Jul 2007 17:25:27 -0700 (PDT) Message-ID: <78c6bd860707191725r14b8bfe3sf15c1f0e30cf82ca@mail.gmail.com> Date: Thu, 19 Jul 2007 20:25:27 -0400 From: "Michael B Allen" To: freebsd-hackers MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Path to executable of current process? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2007 00:52:32 -0000 Hello, I'm looking for an example that uses kvm_getargv but from just googling around I can't seem to find an example. Can someone give me a pointer? Actually what I'm *really* trying to do is port some code that invokes GDB to do a backtrace and I need to give GDB the path to the executable of the current process (e.g. on linux this is /proc//exe) and the pid of the process to trace (easy - getpid). The first argument is trickey since FreeBSD frequently does not have a /proc filesystem. So it seems kvm_getargv should have this path no? Mike