Date: Thu, 26 Aug 2004 05:45:03 -0400 From: Gerard Seibert <gerard-seibert@rcn.com> To: Matthew Seaman <m.seaman@infracaninophile.co.uk>, FreeBSD Question <freebsd-questions@freebsd.org> Subject: Re[4]: Error When Attempting to Use portmanager Message-ID: <20040826054300.8B6F.GERARD-SEIBERT@rcn.com> In-Reply-To: <20040826084500.GA87719@happy-idiot-talk.infracaninophile.co.uk> References: <20040825182516.0767.GERARD-SEIBERT@rcn.com> <20040826084500.GA87719@happy-idiot-talk.infracaninophile.co.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday, August 26, 2004 4:45:00 AM Matthew Seaman <m.seaman@infracaninophile.co.uk> wrote: |>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 the |>example: |> |> # cd /usr/ports/sysutils/portmanager |> # make clean |> # make CFLAGS='-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 |> 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/portmanager/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 |> |> |> |>-- |>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 ********** Reply Separator ********** Thursday, August 26, 2004 5:43:00 AM Thanks for you reply. I will try it this evening. It is amassing what I learn just reading this mail forum.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040826054300.8B6F.GERARD-SEIBERT>