From owner-freebsd-questions@FreeBSD.ORG Wed Mar 26 12:11:54 2003 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 832EA37B404 for ; Wed, 26 Mar 2003 12:11:54 -0800 (PST) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5E9B043FA3 for ; Wed, 26 Mar 2003 12:11:51 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.7/8.12.7) id h2QKBnBF087729 for freebsd-questions@freebsd.org; Wed, 26 Mar 2003 14:11:49 -0600 (CST) (envelope-from dan) Date: Wed, 26 Mar 2003 14:11:49 -0600 From: Dan Nelson To: FreeBSD Questions Message-ID: <20030326201149.GE31787@dan.emsphone.com> References: <20030326200449.GB967@bsdsi.homeunix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030326200449.GB967@bsdsi.homeunix.com> X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.4i X-Spam-Status: No, hits=-26.7 required=5.0 tests=AWL,IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT_MUTT autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) Subject: Re: How to produce debugging symbols? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Mar 2003 20:11:55 -0000 In the last episode (Mar 26), Martin Moeller said: > I have a rather general question on debugging. I'm experiencing some > problems with some programs on FreeBSD 5.0. Because I'm quite a unix > newbie, I can only write to some mailinglists to ask if somebody > knows what to do. > > But I would like to take a few steps to solve my problems on my own. > I read something about gdb and kernel debugging, but find that > somehow disturbing. So I would like to ask a very *stupid* newbie > question: > > I can run a program within gdb, but I don't see the program's source > code. I assume this is meant with debug symbols? How can I compile a > program with those debug symbols? If it's your program, recompile and link with the -g commandline switch added. If it's a base FreeBSD program (or port), edit the Makefile and add a line reading "DEBUG_FLAGS=-g" (this will compile with -g and also no strip the debugging symbols when the binary gets installed). -- Dan Nelson dnelson@allantgroup.com