From: Tom Hughes Date: Thu, 20 May 2021 16:16:06 +0000 (+0100) Subject: Don't look for separate debuginfo if the image has a .debug_info section X-Git-Tag: VALGRIND_3_18_0~119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=93104368952c37268da724231487058ea3eaf1dc;p=thirdparty%2Fvalgrind.git Don't look for separate debuginfo if the image has a .debug_info section Fixes BZ#435908 --- diff --git a/NEWS b/NEWS index 2e8174e6f3..4cf932d303 100644 --- a/NEWS +++ b/NEWS @@ -40,6 +40,8 @@ are not entered into bugzilla tend to get forgotten about or ignored. 434840 PPC64 darn instruction not supported 434296 s390x: False-positive memcheck diagnostics from vector string instructions +435908 valgrind tries to fetch from deubginfod for files which already + have debug information To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/coregrind/m_debuginfo/readelf.c b/coregrind/m_debuginfo/readelf.c index b0f062ddc6..e424e3e7e8 100644 --- a/coregrind/m_debuginfo/readelf.c +++ b/coregrind/m_debuginfo/readelf.c @@ -2879,13 +2879,15 @@ Bool ML_(read_elf_debug_info) ( struct _DebugInfo* di ) /* Look for a build-id */ HChar* buildid = find_buildid(mimg, False, False); - /* Look for a debug image that matches either the build-id or + /* If we don't have a .debug_info section in the main image then + look for a debug image that matches either the build-id or the debuglink-CRC32 in the main image. If the main image doesn't contain either of those then this won't even bother to try looking. This looks in all known places, including the --extra-debuginfo-path if specified and on the --debuginfo-server if specified. */ - if (buildid != NULL || debuglink_escn.img != NULL) { + if (debug_info_escn.img == NULL && + (buildid != NULL || debuglink_escn.img != NULL)) { /* Do have a debuglink section? */ if (debuglink_escn.img != NULL) { UInt crc_offset