This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Causes of differences between source and binary built with symbols while debugging
- From: David Paterson <dnpaterson at gmail dot com>
- To: Jusctsch <schumjs at gmail dot com>
- Cc: gdb at sourceware dot org
- Date: Thu, 6 Oct 2011 09:13:13 +0100
- Subject: Re: Causes of differences between source and binary built with symbols while debugging
- References: <32596213.post@talk.nabble.com>
On Wed, Oct 5, 2011 at 10:13 PM, Jusctsch <schumjs@gmail.com> wrote:
>
> Hello,
> I have a basic question about debugging with GDB when browsing source files.
> I have built my executable binary without any optimization and with -g.
> When debugging after 'source'-ing in my source files, I noticed that they
> did not always line up. They being the source, and the line number provided
> by gdb after loading in the symbols.
One thing to check is that you have definitely compiled and linked the file that
you think you are debugging. If your executable hasn't been fully rebuilt you
may have references to line numbers in an older version of that file.
Try a clean / full rebuild and see if the problem remains.
David P.