From owner-freebsd-questions@FreeBSD.ORG Thu Feb 22 21:46:03 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E1F6116A405 for ; Thu, 22 Feb 2007 21:46:03 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from server.t-hosting.hu (server.t-hosting.hu [217.20.133.7]) by mx1.freebsd.org (Postfix) with ESMTP id 9F0E013C467 for ; Thu, 22 Feb 2007 21:46:03 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by server.t-hosting.hu (Postfix) with ESMTP id E3D189EEC02; Thu, 22 Feb 2007 22:46:02 +0100 (CET) X-Virus-Scanned: amavisd-new at t-hosting.hu Received: from server.t-hosting.hu ([127.0.0.1]) by localhost (server.t-hosting.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id kvIgHND0ICZc; Thu, 22 Feb 2007 22:45:49 +0100 (CET) Received: from [192.168.2.186] (catv-50635cb6.catv.broadband.hu [80.99.92.182]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by server.t-hosting.hu (Postfix) with ESMTP id 3170D9EEB79; Thu, 22 Feb 2007 22:45:49 +0100 (CET) Message-ID: <45DE0F0C.6050005@FreeBSD.org> Date: Thu, 22 Feb 2007 22:45:48 +0100 From: Gabor Kovesdan User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: Giorgos Keramidas References: <20070222160325.8AE0.GERARD@seibercom.net> <20070222213541.GB1781@kobe.laptop> In-Reply-To: <20070222213541.GB1781@kobe.laptop> Content-Type: text/plain; charset=ISO-8859-7; format=flowed Content-Transfer-Encoding: 8bit Cc: freebsd-questions@freebsd.org Subject: Re: How to build program with debug symbols 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: Thu, 22 Feb 2007 21:46:04 -0000 Giorgos Keramidas schrieb: > On 2007-02-22 16:03, Gerard wrote: > >> FreeBSD-6.2 >> I need to know how to build a program with debugging symbols. The >> problem I am having is that claws-mail-2.7.2 continually crashes but >> does not display any debug symbols. I talked with the claws-mail >> people, and they advised me to build a version with debug symbols >> since the output I supplied them was useless without it. Their >> suggestion was that I build from a tarball and use the proper Ąconfig˘ >> flags to get debug symbols included in the program. The problem is >> that I would rather not mess with that scenario, but rather use the >> port version instead. The port version does have an option to build a >> debug version, but apparently, the symbols are stripped out when the >> program is installed. >> >> The port maintainer suggested that I use this is the Makefile: >> >> "STRIP= #empty" >> >> However, he is not even sure if it will work. I just want to find out >> what the best way to go about this is so that I can get this problem >> resolved. >> > > I think it's much better to avoid tweaking ${STRIP} and set DEBUG_FLAGS > instead. You have to make sure that at least the claws-mail-2.7.2 port > is *rebuilt* from source. The following should work fine: > > # cd /usr/ports/mail/claws-mail > # make deinstall > # env DEBUG_FLAGS='-ggdb' make install > > The STRIP variable is explicitly set to an empty value when DEBUG_FLAGS > is defined, so you get both a debugging *and* non-stripped binary by > setting DEBUG_FLAGS. > > Or you can just define the newly introduced WITH_DEBUG macro, which will does the trick for you: make -DWITH_DEBUG install Still, you can customize the DEBUG_FLAGS to set which flags you want to add. Besides, the flags that can do harm (-O[123s] and such) will be stripped out from CFLAGS. Regards, Gabor