mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-17 12:53:17 +08:00
Warn for missing separate debug files only if needed
We shouldn't warn missing separate debug files when debug info isn't needed. PR binutils/27486 * dwarf.c (load_separate_debug_info): Issue warning only if do_debug_links is set. * testsuite/binutils-all/compress.exp: Run objdump and readelf with missing debug file.
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
2021-03-01 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
PR binutils/27486
|
||||||
|
* dwarf.c (load_separate_debug_info): Issue warning only if
|
||||||
|
do_debug_links is set.
|
||||||
|
* testsuite/binutils-all/compress.exp: Run objdump and readelf
|
||||||
|
with missing debug file.
|
||||||
|
|
||||||
2021-03-01 Alan Modra <amodra@gmail.com>
|
2021-03-01 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
PR 27128
|
PR 27128
|
||||||
|
@ -11210,44 +11210,52 @@ load_separate_debug_info (const char * main_filename,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Failed to find the file. */
|
if (do_debug_links)
|
||||||
warn (_("could not find separate debug file '%s'\n"), separate_filename);
|
{
|
||||||
warn (_("tried: %s\n"), debug_filename);
|
/* Failed to find the file. */
|
||||||
|
warn (_("could not find separate debug file '%s'\n"),
|
||||||
|
separate_filename);
|
||||||
|
warn (_("tried: %s\n"), debug_filename);
|
||||||
|
|
||||||
#ifdef EXTRA_DEBUG_ROOT2
|
#ifdef EXTRA_DEBUG_ROOT2
|
||||||
sprintf (debug_filename, "%s/%s", EXTRA_DEBUG_ROOT2, separate_filename);
|
sprintf (debug_filename, "%s/%s", EXTRA_DEBUG_ROOT2,
|
||||||
warn (_("tried: %s\n"), debug_filename);
|
separate_filename);
|
||||||
|
warn (_("tried: %s\n"), debug_filename);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef EXTRA_DEBUG_ROOT1
|
#ifdef EXTRA_DEBUG_ROOT1
|
||||||
sprintf (debug_filename, "%s/%s/%s", EXTRA_DEBUG_ROOT1, canon_dir, separate_filename);
|
sprintf (debug_filename, "%s/%s/%s", EXTRA_DEBUG_ROOT1,
|
||||||
warn (_("tried: %s\n"), debug_filename);
|
canon_dir, separate_filename);
|
||||||
|
warn (_("tried: %s\n"), debug_filename);
|
||||||
|
|
||||||
sprintf (debug_filename, "%s/%s", EXTRA_DEBUG_ROOT1, separate_filename);
|
sprintf (debug_filename, "%s/%s", EXTRA_DEBUG_ROOT1,
|
||||||
warn (_("tried: %s\n"), debug_filename);
|
separate_filename);
|
||||||
|
warn (_("tried: %s\n"), debug_filename);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
sprintf (debug_filename, "%s.debug/%s", canon_dir, separate_filename);
|
sprintf (debug_filename, "%s.debug/%s", canon_dir,
|
||||||
warn (_("tried: %s\n"), debug_filename);
|
separate_filename);
|
||||||
|
warn (_("tried: %s\n"), debug_filename);
|
||||||
|
|
||||||
sprintf (debug_filename, "%s%s", canon_dir, separate_filename);
|
sprintf (debug_filename, "%s%s", canon_dir, separate_filename);
|
||||||
warn (_("tried: %s\n"), debug_filename);
|
warn (_("tried: %s\n"), debug_filename);
|
||||||
|
|
||||||
sprintf (debug_filename, ".debug/%s", separate_filename);
|
sprintf (debug_filename, ".debug/%s", separate_filename);
|
||||||
warn (_("tried: %s\n"), debug_filename);
|
warn (_("tried: %s\n"), debug_filename);
|
||||||
|
|
||||||
sprintf (debug_filename, "%s", separate_filename);
|
sprintf (debug_filename, "%s", separate_filename);
|
||||||
warn (_("tried: %s\n"), debug_filename);
|
warn (_("tried: %s\n"), debug_filename);
|
||||||
|
|
||||||
#if HAVE_LIBDEBUGINFOD
|
#if HAVE_LIBDEBUGINFOD
|
||||||
{
|
{
|
||||||
char *urls = getenv (DEBUGINFOD_URLS_ENV_VAR);
|
char *urls = getenv (DEBUGINFOD_URLS_ENV_VAR);
|
||||||
if (urls == NULL)
|
if (urls == NULL)
|
||||||
urls = "";
|
urls = "";
|
||||||
|
|
||||||
warn (_("tried: DEBUGINFOD_URLS=%s\n"), urls);
|
warn (_("tried: DEBUGINFOD_URLS=%s\n"), urls);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
free (canon_dir);
|
free (canon_dir);
|
||||||
free (debug_filename);
|
free (debug_filename);
|
||||||
|
@ -676,6 +676,7 @@ proc test_gnu_debuglink {} {
|
|||||||
global STRIP
|
global STRIP
|
||||||
global OBJCOPY
|
global OBJCOPY
|
||||||
global OBJDUMP
|
global OBJDUMP
|
||||||
|
global READELF
|
||||||
global gcc_gas_flag
|
global gcc_gas_flag
|
||||||
|
|
||||||
set test "gnu-debuglink"
|
set test "gnu-debuglink"
|
||||||
@ -757,6 +758,20 @@ proc test_gnu_debuglink {} {
|
|||||||
} else {
|
} else {
|
||||||
pass "$test (objdump 2)"
|
pass "$test (objdump 2)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
remote_file host delete tmpdir/testprog.compress
|
||||||
|
set got [remote_exec host [concat sh -c [list "$OBJDUMP --syms tmpdir/testprog > /dev/null"]]]
|
||||||
|
if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
|
||||||
|
fail "$test (objdump with missing link)"
|
||||||
|
} else {
|
||||||
|
pass "$test (objdump with missing link)"
|
||||||
|
}
|
||||||
|
set got [remote_exec host [concat sh -c [list "$READELF -S tmpdir/testprog > /dev/null"]]]
|
||||||
|
if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
|
||||||
|
fail "$test (readelf with missing link)"
|
||||||
|
} else {
|
||||||
|
pass "$test (readelf with missing link)"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if {[is_elf_format]} then {
|
if {[is_elf_format]} then {
|
||||||
|
Reference in New Issue
Block a user