Date: Thu, 16 Oct 2008 17:23:47 -0700 (PDT) From: Nate Eldredge <neldredge@math.ucsd.edu> To: Chuck Robey <chuckr@telenix.org> Cc: FreeBSD-Hackers <freebsd-hackers@freebsd.org> Subject: Re: indicating a debug image Message-ID: <Pine.GSO.4.64.0810161717550.16737@zeno.ucsd.edu> In-Reply-To: <48F7CD5E.8000905@telenix.org> References: <48F7CD5E.8000905@telenix.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.64.0810161717550.16737>