[commit] Fix condition (Re: [patch] Verify byte-by-byte if both files are the same on "remote:")

Ulrich Weigand
2011-10-11T19:07:03Z

Jan Kratochvil wrote:

> + if (verified_as_different || parent_objfile->crc32 != crc)
> + warning (_("the debug information found in \"%s\""
> + " does not match \"%s\" (CRC mismatch).\n"),
> + name, parent_objfile->name);

I just noticed that this still causes spurious warnings since the
condition is incorrect: we want to skip the warning if the parent's
CRC matches the (potential) debuginfo *file* CRC, not the CRC the
debuginfo is supposed to have.

Fixed by the patch below. Tested on arm-linux-gnueabi in remote
testing using --with-sysroot=remote: with no more spurious CRC
mismatch warnings. Committed to mainline as obvious.

Bye,
Ulrich

ChangeLog:

* symfile.c (separate_debug_file_exists): Fix condition.

Index: gdb/symfile.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile.c,v
retrieving revision 1.318
diff -u -p -r1.318 symfile.c
--- gdb/symfile.c 11 Oct 2011 12:58:08 -0000 1.318
+++ gdb/symfile.c 11 Oct 2011 18:33:12 -0000
@@ -1418,7 +1418,7 @@ separate_debug_file_exists (const char *
return 0;
}

- if (verified_as_different || parent_objfile->crc32 != crc)
+ if (verified_as_different || parent_objfile->crc32 != file_crc)
warning (_("the debug information found in \"%s\""
" does not match \"%s\" (CRC mismatch).\n"),
name, parent_objfile->name);

--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com