public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
* [binutils-gdb] i686-w64-mingw32-objdump -WL returns incorrect file paths
@ 2022-09-08  8:58 Nick Clifton
  0 siblings, 0 replies; only message in thread
From: Nick Clifton @ 2022-09-08  8:58 UTC (permalink / raw)
  To: bfd-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=2caffd34df293680755ebad35c618ee68686fcf1

commit 2caffd34df293680755ebad35c618ee68686fcf1
Author: Nick Clifton <nickc@redhat.com>
Date:   Thu Sep 8 09:56:39 2022 +0100

    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.

Diff:
---
 binutils/ChangeLog | 6 ++++++
 binutils/dwarf.c   | 7 +++++++
 2 files changed, 13 insertions(+)

diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index cfb6417b55e..5f8403b158b 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -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>
 
 	PR 29075
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 71d8bc9ed5c..f90f4efac5b 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -5215,6 +5215,8 @@ display_debug_lines_decoded (struct dwarf_section *  section,
 			ix, n_directories);
 		  directory = _("<corrupt>");
 		}
+	      else if (linfo.li_version >= 5)
+		directory = (char *) directory_table[ix];
 	      else
 		directory = (char *) directory_table[ix - 1];
 
@@ -5385,6 +5387,7 @@ display_debug_lines_decoded (struct dwarf_section *  section,
 
 		  if (linfo.li_version < 5)
 		    --file;
+
 		  if (file_table == NULL || n_files == 0)
 		    printf (_("\n [Use file table entry %d]\n"), file);
 		  /* PR 20439 */
@@ -5406,6 +5409,10 @@ display_debug_lines_decoded (struct dwarf_section *  section,
 			    dir, n_directories);
 		      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
 		    printf ("\n%s/%s:\n",
 			    /* The directory index starts counting at 1.  */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-08  8:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-08  8:58 [binutils-gdb] i686-w64-mingw32-objdump -WL returns incorrect file paths Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).