From owner-freebsd-questions Thu Aug 28 05:53:38 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id FAA26086 for questions-outgoing; Thu, 28 Aug 1997 05:53:38 -0700 (PDT) Received: from mail13.digital.com (mail13.digital.com [192.208.46.30]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id FAA26079 for ; Thu, 28 Aug 1997 05:53:35 -0700 (PDT) Received: from cssmuc.frt.dec.com (cssmuc.frt.dec.com [16.186.96.161]) by mail13.digital.com (8.7.5/UNX 1.5/1.0/WV) with SMTP id IAA15494; Thu, 28 Aug 1997 08:44:27 -0400 (EDT) Received: from mofo.frt.dec.com by cssmuc.frt.dec.com; (5.65v3.2/1.1.8.2/14Nov95-0232PM) id AA10695; Thu, 28 Aug 1997 14:44:26 +0200 Received: from mofo.frt.dec.com (localhost [127.0.0.1]) by mofo.frt.dec.com (8.8.6/8.8.5) with ESMTP id OAA03841; Thu, 28 Aug 1997 14:43:23 GMT Message-Id: <199708281443.OAA03841@mofo.frt.dec.com> X-Mailer: exmh version 2.0zeta 7/24/97 To: questions@freebsd.org Cc: Jacques Hugo In-Reply-To: Message from Jacques Hugo of Thu, 28 Aug 1997 10:07:38 +0200. Reply-To: gjennejohn@frt.dec.com Subject: Re: gdb and strip Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 28 Aug 1997 14:43:23 +0000 From: Gary Jennejohn Sender: owner-freebsd-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Jacques Hugo writes: > Hi there ... > > If you write some program, compiled it > but don't strip it, how do you re-read > the source code in it. > > Is there some option in gcc that you have > to add, and can you gdb a binary that' > not stripped and then redirect the source > to a file? > > Thanks. > you have to use the -g flag when compiling so that the binary contains pointers to the source. Then gdb can access the source when you're debugging and show it. However, if you think that this will include the source in the binary, you're off your rocker. I know of no standard way to get the source included in the binary so that gdb can reconstruct it on-the-fly during debugging. The source files have to be available locally. --- Gary Jennejohn (work) gjennejohn@frt.dec.com (home) garyj@muc.de (play) gj@freebsd.org