[haiku-commits] Re: r34788 - in haiku/trunk: build/jam src/system/libroot src/system/libroot/posix src/system/libroot/posix/malloc_debug

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 28 Jan 2010 07:29:24 +0100

On 2010-01-27 at 18:40:43 [+0100], Grzegorz Dąbrowski 
<grzegorz.dabrowski@xxxxxxxxx> wrote:
> On Mon, Dec 28, 2009 at 1:13 AM,  <ingo_weinhold@xxxxxx> wrote:
> > Author: bonefish
> > Date: 2009-12-28 01:13:17 +0100 (Mon, 28 Dec 2009)
> > New Revision: 34788
> > Changeset: http://dev.haiku-os.org/changeset/34788/haiku
> >
> > Modified:
> >   haiku/trunk/build/jam/OptionalPackages
> >   haiku/trunk/src/system/libroot/Jamfile
> >   haiku/trunk/src/system/libroot/posix/Jamfile
> >   haiku/trunk/src/system/libroot/posix/malloc_debug/Jamfile
> > Log:
> > * Build library libroot_debug.so, which is the standard libroot.so with 
> > the
> >  debug heap implementation.
> > * Added libroot_debug.so to the DevelopmentMin optional package. Since it 
> > has
> >  the same soname as the standard libroot, it can simply be specified in
> >  LD_PRELOAD to run a program with that version.
> 
> Is it possible to build libroot_debug.so  with debug symbols? I mean
> the replacement for:
> SetConfigVar DEBUG: src HAIKU_TOP system libroot: 1: global
> It could be helpful for debugging pthreads and others.

It's not trivial at least, since libroot.so and libroot_debug.so share the 
same objects (save for the heap implementation). So the objects would have to 
be explicitly built twice. This would either require to use new Jamfiles in 
separate directories or to implement specific rules and adjust all libroot 
Jamfiles to use them. In either case quite a bit of work.

Alternatively it would be possible to add "-g" for the libroot build 
unconditionally and strip debug information when linking libroot.so. That 
would not disable optimization and thus not yield nicely debuggable code, but 
at least allow for inspecting variables and parameters (where not optimized 
away).

It might be a good idea to build everything with debug information anyway, at 
least for the non-final releases. If nothing else it would at least give more 
insightful stack traces. The downside is much heavier images and increased 
build times.

CU, Ingo

Other related posts: