public inbox for binutils-cvs@sourceware.org
help / color / mirror / Atom feed
From: Alok Kumar Sharma <alok@sourceware.org>
To: bfd-cvs@sourceware.org
Subject: [binutils-gdb] Modified changes for split-dwarf and dwarf-5.
Date: Mon,  4 Jul 2022 11:16:57 +0000 (GMT)	[thread overview]
Message-ID: <20220704111657.DE9693858282@sourceware.org> (raw)

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

commit 407115429b349a55561213a61e910756c965f902
Author: Bhuvanendra Kumar N <Bhuvanendra.KumarN@amd.com>
Date:   Mon Jul 4 16:20:29 2022 +0530

    Modified changes for split-dwarf and dwarf-5.
    
            * dwarf.c(process_debug_info): Include DW_TAG_skeleton_unit.
            (display_debug_str_offsets): While dumping .debug_str_offsets.dwo,
            pass proper str_offsets_base to fetch_indexed_string().
            (load_separate_debug_files): Skip DWO ID dump for dwarf-5.

Diff:
---
 binutils/dwarf.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 535d4ab6d5d..71f2617e5a7 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -4038,6 +4038,7 @@ process_debug_info (struct dwarf_section * section,
 	      need_base_address = 0;
 	      break;
 	    case DW_TAG_compile_unit:
+	    case DW_TAG_skeleton_unit:
 	      need_base_address = 1;	
 	      need_dwo_info = do_loc;
 	      break;
@@ -7800,6 +7801,7 @@ display_debug_str_offsets (struct dwarf_section *section,
   unsigned char *start = section->start;
   unsigned char *end = start + section->size;
   unsigned char *curr = start;
+  dwarf_vma debug_str_offsets_hdr_len;
 
   const char *suffix = strrchr (section->name, '.');
   bool dwo = suffix && strcmp (suffix, ".dwo") == 0;
@@ -7822,9 +7824,13 @@ display_debug_str_offsets (struct dwarf_section *section,
 	{
 	  SAFE_BYTE_GET_AND_INC (length, curr, 8, end);
 	  entry_length = 8;
+	  debug_str_offsets_hdr_len = 16;
 	}
       else
-	entry_length = 4;
+	{
+	  entry_length = 4;
+	  debug_str_offsets_hdr_len = 8;
+	}
 
       unsigned char *entries_end;
       if (length == 0)
@@ -7876,7 +7882,7 @@ display_debug_str_offsets (struct dwarf_section *section,
 	  SAFE_BYTE_GET_AND_INC (offset, curr, entry_length, entries_end);
 	  if (dwo)
 	    string = (const unsigned char *)
-	      fetch_indexed_string (idx, NULL, entry_length, dwo, 0);
+	      fetch_indexed_string (idx, NULL, entry_length, dwo, debug_str_offsets_hdr_len);
 	  else
 	    string = fetch_indirect_string (offset);
 
@@ -12013,7 +12019,7 @@ load_separate_debug_files (void * file, const char * filename)
 		      printf (_("  Directory: %s\n"), dir ? dir : _("<not-found>"));
 		      if (id != NULL)
 			display_data (printf (_("  ID:       ")), (unsigned char *) id, 8);
-		      else
+		      else if (debug_information[0].dwarf_version != 5)
 			printf (_("  ID:        <not specified>\n"));
 		      printf ("\n\n");
 		    }


                 reply	other threads:[~2022-07-04 11:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220704111657.DE9693858282@sourceware.org \
    --to=alok@sourceware.org \
    --cc=bfd-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).