From owner-freebsd-questions@FreeBSD.ORG Mon Oct 22 20:56:08 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 69D2016A41B for ; Mon, 22 Oct 2007 20:56:08 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from mail0.rawbw.com (mail0.rawbw.com [198.144.192.41]) by mx1.freebsd.org (Postfix) with ESMTP id 04F9513C4BB for ; Mon, 22 Oct 2007 20:56:06 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from mail0.rawbw.com (localhost [127.0.0.1]) by mail0.rawbw.com (8.13.8/8.13.8) with ESMTP id l9MKt8Wr021851; Mon, 22 Oct 2007 13:55:08 -0700 (PDT) Received: (from www@localhost) by mail0.rawbw.com (8.13.8/8.13.8/Submit) id l9MKt8pk021850; Mon, 22 Oct 2007 13:55:08 -0700 (PDT) X-Authentication-Warning: mail0.rawbw.com: www set sender to yuri@rawbw.com using -f Received: from new-5000.Cadence.COM (new-5000.Cadence.COM [158.140.1.25]) by webmail.rawbw.com (IMP) with HTTP for ; Mon, 22 Oct 2007 13:55:07 -0700 Message-ID: <1193086507.471d0e2bca8aa@webmail.rawbw.com> Date: Mon, 22 Oct 2007 13:55:07 -0700 From: Yuri To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.1 X-Originating-IP: 158.140.1.25 Cc: yuri@tsoft.com Subject: How to match /proc/#/map entries to the library/executable file name 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: Mon, 22 Oct 2007 20:56:08 -0000 Hi, I need to find the file name for every /proc/#/map entry for a program linked statically. But some of them end with '-'. Where can I find documentation describing /pcor/#/map file format, explaining why these dashes are there? And how to find the corresponding filenames? I found a method based on 'dladdr' function. But this seems to only work when dynamic libraries are enabled. Here is /proc//map file: 0x38000000 0x38193000 403 0 0xc656dc60 r-x 1 0 0x0 COW NC vnode /usr/local/xxx/bin/xxx 0x38193000 0x38c61000 7 0 0xc6a8dbdc rw- 1 0 0x2180 NCOW NNC default - 0xbfbe0000 0xbfc00000 2 0 0xc67506b4 rwx 1 0 0x2180 NCOW NNC default - Thanks, Yuri