Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Oct 2017 23:11:31 +0200
From:      Guido Falsi <mad@madpilot.net>
To:        Piotr Kubaj <pkubaj@anongoth.pl>, freebsd-ports@freebsd.org
Subject:   Re: Debugging ports
Message-ID:  <b612c6d0-41f1-4b6a-b424-033fa567d8bf@madpilot.net>
In-Reply-To: <20171017160445.GA31080@smtp.iq.pl>
References:  <20171017160445.GA31080@smtp.iq.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <mad@madpilot.net>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?b612c6d0-41f1-4b6a-b424-033fa567d8bf>