public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Ignore DWARF debug information for -gsplit-dwarf with dwarf-5.
@ 2022-09-29 12:43 Potharla, Rupesh
  2022-09-29 15:00 ` Jan Beulich
  0 siblings, 1 reply; 6+ messages in thread
From: Potharla, Rupesh @ 2022-09-29 12:43 UTC (permalink / raw)
  To: Potharla, Rupesh via Binutils
  Cc: Parasuraman, Hariharan, George, Jini Susan, Kumar N, Bhuvanendra


[-- Attachment #1.1: Type: text/plain, Size: 951 bytes --]

[AMD Official Use Only - General]

Hi,

Bfd is throwing errors for programs compiled with -gsplit-dwarf with clang and dwarf-5.  Made the code changes skipping DWO_id while reading debug_info header. Can you review the code changes and send in your comments/suggestions?

Inline Patch:


Skip dwo_id for split dwarf.
* dwarf2.c (parse_comp_unit): Skip DWO_id for DW_UT_skeleton.
---
bfd/dwarf2.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index 4a6a1e40185..011bf886e16 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -4441,6 +4441,10 @@ parse_comp_unit (struct dwarf2_debug *stash,
       return NULL;
     }

+  /* Skip DWO_id field.  */
+  if (unit_type == DW_UT_skeleton)
+    info_ptr += 8;
+
   /* Read the abbrevs for this compilation unit into a table.  */
   abbrevs = read_abbrevs (abfd, abbrev_offset, stash, file);
   if (! abbrevs)
--
2.25.1

Regards,
Rupesh P


[-- Attachment #2: 0001-Ignore-DWARF-debug-information-for-gsplit-dwarf-with.patch --]
[-- Type: application/octet-stream, Size: 852 bytes --]

From f197ae03c3b0ae83334e1c3a799dcc094faa84f8 Mon Sep 17 00:00:00 2001
From: rupesh potharla <rupesh.potharla@amd.com>
Date: Thu, 29 Sep 2022 17:49:07 +0530
Subject: [PATCH] Ignore DWARF debug information for -gsplit-dwarf with
 dwarf-5.

Skip dwo_id for split dwarf.
 * dwarf2.c (parse_comp_unit): Skip DWO_id for DW_UT_skeleton.
---
 bfd/dwarf2.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bfd/dwarf2.c b/bfd/dwarf2.c
index 4a6a1e40185..011bf886e16 100644
--- a/bfd/dwarf2.c
+++ b/bfd/dwarf2.c
@@ -4441,6 +4441,10 @@ parse_comp_unit (struct dwarf2_debug *stash,
       return NULL;
     }
 
+  /* Skip DWO_id field.  */
+  if (unit_type == DW_UT_skeleton)
+    info_ptr += 8;
+
   /* Read the abbrevs for this compilation unit into a table.  */
   abbrevs = read_abbrevs (abfd, abbrev_offset, stash, file);
   if (! abbrevs)
-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-09-30  5:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-29 12:43 [PATCH] Ignore DWARF debug information for -gsplit-dwarf with dwarf-5 Potharla, Rupesh
2022-09-29 15:00 ` Jan Beulich
2022-09-29 15:54   ` Potharla, Rupesh
2022-09-29 16:03     ` Jan Beulich
2022-09-29 16:39       ` Potharla, Rupesh
2022-09-30  5:53         ` Jan Beulich

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).