From owner-freebsd-questions@FreeBSD.ORG Thu Aug 26 09:45:06 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D708616A4CE for ; Thu, 26 Aug 2004 09:45:06 +0000 (GMT) Received: from smtp01.mrf.mail.rcn.net (smtp01.mrf.mail.rcn.net [207.172.4.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id A9D8943D67 for ; Thu, 26 Aug 2004 09:45:06 +0000 (GMT) (envelope-from gerard-seibert@rcn.com) Received: from 207-237-110-41.c3-0.crm-ubr4.crm.ny.cable.rcn.com ([207.237.110.41] helo=[127.0.0.1]) by smtp01.mrf.mail.rcn.net with esmtp (Exim 3.35 #7) id 1C0Gob-0002jK-00; Thu, 26 Aug 2004 05:45:05 -0400 Date: Thu, 26 Aug 2004 05:45:03 -0400 From: Gerard Seibert To: Matthew Seaman , FreeBSD Question Sender: Gerard@FreeBSD.ORG, Seibert@FreeBSD.ORG 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> Message-Id: <20040826054300.8B6F.GERARD-SEIBERT@rcn.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.11.02 [en] Subject: Re[4]: Error When Attempting to Use portmanager X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: gerard-seibert@rcn.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Aug 2004 09:45:07 -0000 On Thursday, August 26, 2004 4:45:00 AM Matthew Seaman 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.