From owner-freebsd-ports@freebsd.org Tue Oct 17 21:11:46 2017 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13335E47816 for ; Tue, 17 Oct 2017 21:11:46 +0000 (UTC) (envelope-from mad@madpilot.net) Received: from mail.madpilot.net (grunt.madpilot.net [78.47.145.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEE4483A78 for ; Tue, 17 Oct 2017 21:11:45 +0000 (UTC) (envelope-from mad@madpilot.net) Received: from mail (mail [192.168.254.3]) by mail.madpilot.net (Postfix) with ESMTP id 3yGntd1t02zZqh; Tue, 17 Oct 2017 23:11:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=madpilot.net; h= content-transfer-encoding:content-language:content-type :content-type:in-reply-to:mime-version:user-agent:date:date :message-id:from:from:references:subject:subject:received :received; s=mail; t=1508274691; x=1510089092; bh=EvgXc/Cbz5n/aH 3OGDWnSflrugiZD+htBHrSLq4T/4Y=; b=TNbkrf9/QX7yXbmhlSb0bYnGtY8tdV SXxC8ritc77D9I20mZui7p1PGE7XALuclPDZ3E4wXzM1iVVZlcMq+Rwk6SI+j1Sn bsJ7LnihFpkVEst0K287EH+JAaVIRKsM7yKEp2ZWs9JMkUsdIvBJlM19SJWcNFhR Tu5XSV6dxncZ0= Received: from mail.madpilot.net ([192.168.254.3]) by mail (mail.madpilot.net [192.168.254.3]) (amavisd-new, port 10024) with ESMTP id TNtlEK-PCcVc; Tue, 17 Oct 2017 23:11:31 +0200 (CEST) Received: from tommy.madpilot.net (micro.madpilot.net [88.149.173.206]) by mail.madpilot.net (Postfix) with ESMTPSA; Tue, 17 Oct 2017 23:11:31 +0200 (CEST) Subject: Re: Debugging ports To: Piotr Kubaj , freebsd-ports@freebsd.org References: <20171017160445.GA31080@smtp.iq.pl> From: Guido Falsi Message-ID: Date: Tue, 17 Oct 2017 23:11:31 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171017160445.GA31080@smtp.iq.pl> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2017 21:11:46 -0000 On 10/17/2017 18:04, Piotr Kubaj via freebsd-ports wrote: > Hi all, > > I am preparing a new port. However, I hit an assertion fail when > starting the binary. The developer is willing to help me, provided that > I send him backtrace and values from the structure that hits assertion > failure. > > Thing is, recompiling with WITH_DEBUG doesn't help (I only get memory > addresses in gdb), nor does -DCMAKE_BUILD_TYPE=Debug to CMAKE_ARGS (the > port uses CMake). > > What should I do to get necessary date? > You should add "WITH_DEBUG=yes" in your make.conf file, then recompile any port in which you need debugging symbols. It will automatically disable optimizations, add -g to CFLAGS and add many other common knobs for any port. Most ports needing special care to get debugging binaries have extra directives in their Makefiles, enabled by that same flag. Be aware that compiling a debugging version requires more memory than a normal version, for big ports it could get REALLY big. I was not able to compile a debugging version of llvm40 with 16 GiB RAM (one poudriere jail using make jobs, maybe without parallelization it could be done). If you're using poudriere to build a whole set of ports you could use something like this (verbatim from my machine): WITH_DEBUG= yes .if ${.CURDIR:M*lang/ruby*} || ${.CURDIR:M*devel/llvm*} || ${.CURDIR:M*lang/gcc*} || ${.CURDIR:M*devel/gdb*} || ${.CURDIR:M*www/webkit*} .undef WITH_DEBUG .endif (obviously I'm not debugging any of those which are quite memory hungry when building debugging versions, but I'm debugging other things depending on them) Hope this helps. -- Guido Falsi