From owner-freebsd-questions@FreeBSD.ORG Mon Aug 2 14:18:52 2010 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 5648E1065672 for ; Mon, 2 Aug 2010 14:18:52 +0000 (UTC) (envelope-from glarkin@FreeBSD.org) Received: from mail1.sourcehosting.net (113901-app1.sourcehosting.net [72.32.213.11]) by mx1.freebsd.org (Postfix) with ESMTP id 316948FC13 for ; Mon, 2 Aug 2010 14:18:51 +0000 (UTC) Received: from 68-189-245-235.dhcp.oxfr.ma.charter.com ([68.189.245.235] helo=cube.entropy.prv) by mail1.sourcehosting.net with esmtp (Exim 4.69 (FreeBSD)) (envelope-from ) id 1Ofvqn-00023g-OO; Mon, 02 Aug 2010 10:18:50 -0400 Received: from [127.0.0.1] (fireball.entropy.prv [192.168.1.12]) by cube.entropy.prv (Postfix) with ESMTP id EEFA743345FF; Mon, 2 Aug 2010 10:10:06 -0400 (EDT) Message-ID: <4C56D167.5000503@FreeBSD.org> Date: Mon, 02 Aug 2010 10:08:39 -0400 From: Greg Larkin Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Roland Smith References: <20100801072824.0a3989bf@scorpio> <20100802133831.GA88816@slackbox.erewhon.net> In-Reply-To: <20100802133831.GA88816@slackbox.erewhon.net> X-Enigmail-Version: 0.96.0 OpenPGP: id=1C940290 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.1 (/) Cc: freebsd-questions@freebsd.org Subject: Re: Setting Debug flag in /etc/make.conf X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: glarkin@FreeBSD.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Aug 2010 14:18:52 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Roland Smith wrote: > On Sun, Aug 01, 2010 at 07:28:24AM -0400, Jerry wrote: >> I have been having problems with several different programs lately. >> Would there be any serious drawback to simply setting: "WITH_DEBUG= " >> in the /etc/make.conf file to force everything I build/rebuild to be >> built with debug symbols? > > No. > > You are assuming every program's Makefile uses WITH_DEBUG that way! The base > system doesn't for one. And neither do all ports. To look for yourself, use > the following command; > > find /usr/ports/ -type f -name Makefile -exec grep -H DEBUG {} \; > > While a lot use WITH_DEBUG, not all ports do, and some use other options, like > NODEBUG or DEBUGFLAGS, or DEBUGGING. > > You'd have to look into the programs in question to see how to enable > debugging for those. > > Roland WITH_DEBUG has special meaning in the ports infrastructure, and as long as a specific port uses CFLAGS during compilation, it will be compiled with debugging symbols when WITH_DEBUG is enabled. Some ports also check the value of WITH_DEBUG within their own Makefile in order to set port-specific debug build options. See this excerpt from /usr/ports/Mk/bsd.port.mk: # WITH_DEBUG - If set, debugging flags are added to CFLAGS and the # binaries don't get stripped by INSTALL_PROGRAM. # Besides, individual ports might add their specific # to produce binaries for debugging purposes. # You can override the debug flags that are passed to # the compiler by setting DEBUG_FLAGS. It is set to # "-g" at default. Just put the following in /etc/make.conf and then recompile the ports you want to include debug symbols: WITH_DEBUG= yes Hope that helps, Greg - -- Greg Larkin http://www.FreeBSD.org/ - The Power To Serve http://www.sourcehosting.net/ - Ready. Set. Code. http://twitter.com/sourcehosting/ - Follow me, follow you -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFMVtFn0sRouByUApARAvlbAKDKwV2anUR87ShERsHVsCpidSof5wCgtb8U 27W9F1G2DmKiebrDrgCe+0c= =Xhvf -----END PGP SIGNATURE-----