This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Causes of differences between source and binary built with symbols while debugging


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]