This is the mail archive of the 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]

[rfc] False separate debuginfo warning with "remote:" access


when doing cross-testing using a GDB built with --with-sysroot=remote:
against an Ubuntu ARM distribution, test cases will fail due to spurious
warnings along the lines of:

  warning: the debug information found in
  "remote:/lib/arm-linux-gnueabi/" does not match
  "remote:/lib/arm-linux-gnueabi/" (CRC mismatch).

This is due to a combination of factors:

On the target system, /lib/arm-linux-gnueabi/ is a symlink to That file /lib/arm-linux-gnueabi/ had its
debuginfo stripped and carries a .gnu_debuglink section pointing to
"". The separate debuginfo is in a file (that would be
installed to) /usr/lib/debug/lib/arm-linux-gnueabi/

On the host system, GDB will take the base filename from the .gnu_debuglink
section and search a variety of paths for the debuginfo file. These include
/lib/arm-linux-gnueabi itself, as well as /lib/arm-linux-gnueabi/.debug and

Due to the combination of the factors that the debuginfo file may have the
same basename as the underlying shared library file, and that the debuginfo
directory search path includes the directory containing the underlying
shared library file, it may happen that one of the files considered as
potential debuginfo file is actually the original shared library itself.

Since GDB will then check CRCs and determine that the shared library is
not actually itself the debuginfo file, we would get a warning as above.
To avoid this spurious warning, GDB will omit printing it if it detects
the situation that the attempted debuginfo is actually the underlying

For this purpose, GDB will consider the two files identical if either of
those two checks succeed: the filenames are identical, or "stat" on both
files returns an identical device/inode pair.  Note that the "stat" check
was added by Jan to fix this very problem on (native) Debian:

Usually, the filename check will suffice (and this works with "remote:"
access too). However, the filename check fails if the shared library is
referenced via a symbolic link as in this case. Normally, the "stat" check
would still catch this situation. However, with "remote:" access, "stat"
is not implemented.

To fix this, either of the following two approaches could be employed:
- Implement "stat" for the "remote:" file access protocol (but this would
  imply extending the remote protocol, and wouldn't help with old gdbservers
  on the other side)
- Omit the potentially spurious warning if the remote protocol is used to
  access the file (but this would also omit the warning if we get a real
  debuginfo mismatch due to out-of-date debuginfo)

Any thoughs?  Am I missing another option here?


  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE

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