From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 17 00:23:48 2008 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 57DC81065696 for ; Fri, 17 Oct 2008 00:23:48 +0000 (UTC) (envelope-from neldredge@math.ucsd.edu) Received: from euclid.ucsd.edu (euclid.ucsd.edu [132.239.145.52]) by mx1.freebsd.org (Postfix) with ESMTP id 393C28FC18 for ; Fri, 17 Oct 2008 00:23:48 +0000 (UTC) (envelope-from neldredge@math.ucsd.edu) Received: from zeno.ucsd.edu (zeno.ucsd.edu [132.239.145.22]) by euclid.ucsd.edu (8.11.7p3+Sun/8.11.7) with ESMTP id m9H0Nl607108; Thu, 16 Oct 2008 17:23:48 -0700 (PDT) Received: from localhost (neldredg@localhost) by zeno.ucsd.edu (8.11.7p3+Sun/8.11.7) with ESMTP id m9H0NlJ09271; Thu, 16 Oct 2008 17:23:47 -0700 (PDT) X-Authentication-Warning: zeno.ucsd.edu: neldredg owned process doing -bs Date: Thu, 16 Oct 2008 17:23:47 -0700 (PDT) From: Nate Eldredge X-X-Sender: neldredg@zeno.ucsd.edu To: Chuck Robey In-Reply-To: <48F7CD5E.8000905@telenix.org> Message-ID: References: <48F7CD5E.8000905@telenix.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: FreeBSD-Hackers Subject: Re: indicating a debug image 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, 17 Oct 2008 00:23:48 -0000 On Thu, 16 Oct 2008, Chuck Robey wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I was wondering, for FreeBSD images, is there a symbol that one could look for, > to indicate if image had debug symbols? I know you could destroy that by just > stripping, I just wanted to know if there is any way to definitely tell, short > of firing up gdb and looking for info. There's really three possibilities: 1. Image has no symbols 2. Image has only non-debug symbols (e.g. global functions and variables) 3. Image has debug symbols (e.g. line numbers, local variables) strip(1) or gcc -s produces #1. gcc without -g produces #2. gcc -g produces #3. You can distinguish #1 because 'nm image' will give no output. nm and objdump don't appear able to distinguish #2 and #3, but readelf -w will give a bunch of output for #3 and none for #2. Does that help? -- Nate Eldredge neldredge@math.ucsd.edu