i686-w64-mingw32-objdump -WL returns incorrect file paths

PR 29523
	* dwarf.c (display_debug_lines_decoded): Correctly handle DWARF-5
	directory and filename tables.
This commit is contained in:
Nick Clifton 2022-09-08 09:56:39 +01:00
parent f42546b6cc
commit 2caffd34df
2 changed files with 13 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2022-09-08 Nick Clifton <nickc@redhat.com>
PR 29523
* dwarf.c (display_debug_lines_decoded): Correctly handle DWARF-5
directory and filename tables.
2022-09-02 Aaron Merey <amerey@redhat.com> 2022-09-02 Aaron Merey <amerey@redhat.com>
PR 29075 PR 29075

View File

@ -5215,6 +5215,8 @@ display_debug_lines_decoded (struct dwarf_section * section,
ix, n_directories); ix, n_directories);
directory = _("<corrupt>"); directory = _("<corrupt>");
} }
else if (linfo.li_version >= 5)
directory = (char *) directory_table[ix];
else else
directory = (char *) directory_table[ix - 1]; directory = (char *) directory_table[ix - 1];
@ -5385,6 +5387,7 @@ display_debug_lines_decoded (struct dwarf_section * section,
if (linfo.li_version < 5) if (linfo.li_version < 5)
--file; --file;
if (file_table == NULL || n_files == 0) if (file_table == NULL || n_files == 0)
printf (_("\n [Use file table entry %d]\n"), file); printf (_("\n [Use file table entry %d]\n"), file);
/* PR 20439 */ /* PR 20439 */
@ -5406,6 +5409,10 @@ display_debug_lines_decoded (struct dwarf_section * section,
dir, n_directories); dir, n_directories);
printf (_("\n <over large directory table entry %u>\n"), dir); printf (_("\n <over large directory table entry %u>\n"), dir);
} }
else if (linfo.li_version >= 5)
printf ("\n%s/%s:\n",
/* The directory index starts counting at 0. */
directory_table[dir], file_table[file].name);
else else
printf ("\n%s/%s:\n", printf ("\n%s/%s:\n",
/* The directory index starts counting at 1. */ /* The directory index starts counting at 1. */