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: RFC: include mod time and size in DWARF file name table


> Does anybody see any problems with this approach that I just havn't
> run into yet? And if it works, would the gdb developers support a
> change request to GCC/binutils?

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.

In other words, it becomes hard to tell whether you actually have the
source code that matches your binaries -- because there will always be
diffs between the binaries you're investigating, and the binaries that
you just compiled from source.  You start needing more and more
complicated "object file diff" tools, which can have their own obscure
failures because they aren't commonly used like "cmp" and "diff" are.

At Cygnus we weeded out all the ways in which dates, times, temporary
file names, hostnames, etc, were wending their way into object files.
We did that so we could make damn sure that the compiler was producing
the exact same object code when compiling on every host platform.  So
that we could make sure that the 3-phase compiler bootstrap produced
the same object code when the compiler was compiled with itself, as
when the compiler was compiled with some other compiler.  So that
we could verify that a Linux distribution that claims to ship "matching
source code" actually does ship the source code that matches all their
binaries.  (So far I don't know of any distro that actually does
validate this -- so I suspect they are failing in a variety of ways.
What isn't regularly tested is probably broken.)

We found many, many bugs of all sorts by being able to do direct
binary comparison to detect allegedly "just the same" object files
that actually weren't the same.  Uninitialized variables, alignment
issues, byte order problems, freeing of memory before using it, etc,
etc, etc, all turn up as minor, minor changes in the generated object
files.  The minor loss of function such as not having GDB warn you
when you invoke the wrong symbol file, is well worth the price of
immediately and automatically detecting all those bugs.

	John


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