From: Martin Runge <martin.runge@web.de>
To: Joel Brobecker <brobecker@adacore.com>
Cc: John Gilmore <gnu@toad.com>,
gdb@sourceware.org,
Martin Runge <martin.runge@rohde-schwarz.com>
Subject: Re: RFC: include mod time and size in DWARF file name table
Date: Mon, 14 Jan 2013 12:31:00 -0000 [thread overview]
Message-ID: <CAF4KFGpZVzH0sseUyAkCJiTT+MU0QyNEWPNQ8EL8yhsrQZ=i2w@mail.gmail.com> (raw)
In-Reply-To: <20130113055406.GX3567@adacore.com>
Thanks for your replies, I now understand that just looking at the
modification time (and size) is not exact enough:
We often use code generators in our tooling (moc, uic, resource
compiler from Qt, as well as flex, bison and many, many more). They
generate the source files fed into gcc at build time. So the compiler
will put the generation timestamp into the mentioned fields of the
debug info, which will differ on every single rebuild even if the
sources (those under version control) did not change at all.
On thing is about making sure that one uses compatible binaries/symbol
files on host and target for remote debugging. This is necessary for
gdb to work correctly. The other thing is about finding errors caused
by incorrect builds and maybe give gdb the needed features to detect
these problems, too. E.g. being able to find out, why the binaries
differ, what source file caused the problem.
There are still some cases left that stop gdb from working correctly
that cannot be solved by binary comparison:
Imagine an executable that uses a library. The executable is not
changed very often, but the library is rebuild every day. If the
library's interface (defined in a header file included by both)
changes, you get a process (the executable with the library loaded)
that knows two versions of the things defined in that header file. How
can this be detected, once the wrong build messed things up?
Similar error can be introduced by using different compiler switches
or compiler versions, possibly with different defines set by default
for building both.
Actually its about debugging your build system.
best regards
Martin
2013/1/13 Joel Brobecker <brobecker@adacore.com>:
>> Yes. The big problem with this approach is that you can never compile
>> the same source code files to produce the same binary code files.
> [snip]
>
> I can also confirm that he have had many reports about this as well.
>
> --
> Joel
next prev parent reply other threads:[~2013-01-14 12:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-12 13:24 Martin Runge
2013-01-13 4:19 ` John Gilmore
2013-01-13 5:54 ` Joel Brobecker
2013-01-14 12:31 ` Martin Runge [this message]
2013-01-15 17:51 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAF4KFGpZVzH0sseUyAkCJiTT+MU0QyNEWPNQ8EL8yhsrQZ=i2w@mail.gmail.com' \
--to=martin.runge@web.de \
--cc=brobecker@adacore.com \
--cc=gdb@sourceware.org \
--cc=gnu@toad.com \
--cc=martin.runge@rohde-schwarz.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox