Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Aug 2004 09:45:00 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        Gerard Seibert <gerard-seibert@rcn.com>
Cc:        FreeBSD Question <freebsd-questions@freebsd.org>
Subject:   Re: Error When Attempting to Use portmanager
Message-ID:  <20040826084500.GA87719@happy-idiot-talk.infracaninophile.co.uk>
In-Reply-To: <20040825182516.0767.GERARD-SEIBERT@rcn.com>
References:  <200408241903.03275.gerard-seibert@rcn.com> <E1BzsJ1-000Pwz-00@u1030.c03.escapebox.net> <20040825182516.0767.GERARD-SEIBERT@rcn.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--FL5UXtIhxfXey3p5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Aug 25, 2004 at 06:30:17PM -0400, Gerard Seibert wrote:

> OK, I am not that knowledgable about compiling programs, etc. Exactly how
> do I recompile with ("-g" flag on cc). Does this cause it to get a
> backtrace? If not, then how do I go about it?

To compile a program from ports with '-g' you should be able to use
the CFLAGS make variable from /etc/make.conf (ideally, you should be
able to override it from the environment or the command line and avoid
having to fiddle with that file at all, but YMMV).  Taking portmanager as t=
he
example:

    # cd /usr/ports/sysutils/portmanager
    # make clean
    # make CFLAGS=3D'-g -O' all

This will leave you with a copy of the portmanager executable in

    ${WRKDIRPREFIX}/sysutils/portmanager/work/portmanager-0.2.0/portmanager

(${WRKDIRPREFIX} will be /usr/ports, unless you've deliberately changed it)

    % file portmanager=20
    portmanager: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD=
), for FreeBSD 4.9.1, dynamically linked (uses shared libs), not stripped

That 'not stripped' part is important: it means that this copy of the
executable contains all of the debug symbols the '-g' puts in.
However, if you go ahead and install the port, all of those symbols
will be stripped out -- debug symbols generally take up a huge amount
of space, and that's a waste unless you are actually debugging things.

All is not lost though: go ahead and install the portmanager port, and
do whatever it was that you did which caused it to dump core.  Do
*not* run 'make clean' in the port directory.

You should have a file portmanager.core To obtain a stack trace with
useful information, run:

    # gdb ${WRKDIRPREFIX}/sysutils/portmanager/work/portmanager-0.2.0/portm=
anager/portmanager -c portmanager.core

(ie. tell gdb to use the unstripped copy of the program, and match it
against the core dump.)

Then when it has loaded all of the symbols etc., type:

    > where

Cut'n'paste that output into your e-mail report to the developers, but
make sure you keep the corefile and the unstripped version of
portmanager to hand, as you may well be asked to run some other gdb(1)
commands to extract further information.

	Cheers,

	Matthew



--=20
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

--FL5UXtIhxfXey3p5
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (FreeBSD)

iD8DBQFBLaMMiD657aJF7eIRAubrAJ0QyEzesg0j4arOv0r1oRf0zyVbXACfcI3c
oBp1AeKH7F9IEw3xBFNLY1w=
=teI+
-----END PGP SIGNATURE-----

--FL5UXtIhxfXey3p5--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040826084500.GA87719>