Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Aug 1997 14:43:23 +0000
From:      Gary Jennejohn <garyj@mofo.frt.dec.com>
To:        questions@freebsd.org
Cc:        Jacques Hugo <jacques@wired.ctech.ac.za>
Subject:   Re: gdb and strip 
Message-ID:  <199708281443.OAA03841@mofo.frt.dec.com>
In-Reply-To: Message from Jacques Hugo <jacques@wired.ctech.ac.za>  of Thu, 28  Aug 1997 10:07:38 %2B0200.

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

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





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