From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2114) id DE9693858282; Mon, 4 Jul 2022 11:16:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DE9693858282 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Alok Kumar Sharma To: bfd-cvs@sourceware.org Subject: [binutils-gdb] Modified changes for split-dwarf and dwarf-5. X-Act-Checkin: binutils-gdb X-Git-Author: Bhuvanendra Kumar N X-Git-Refname: refs/heads/master X-Git-Oldrev: a0f3a4c646cce619b6c5392b4ec8dcceeb5729ba X-Git-Newrev: 407115429b349a55561213a61e910756c965f902 Message-Id: <20220704111657.DE9693858282@sourceware.org> Date: Mon, 4 Jul 2022 11:16:57 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jul 2022 11:16:58 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D407115429b34= 9a55561213a61e910756c965f902 commit 407115429b349a55561213a61e910756c965f902 Author: Bhuvanendra Kumar N Date: Mon Jul 4 16:20:29 2022 +0530 Modified changes for split-dwarf and dwarf-5. =20 * dwarf.c(process_debug_info): Include DW_TAG_skeleton_unit. (display_debug_str_offsets): While dumping .debug_str_offsets.d= wo, 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 =3D 0; break; case DW_TAG_compile_unit: + case DW_TAG_skeleton_unit: need_base_address =3D 1;=09 need_dwo_info =3D do_loc; break; @@ -7800,6 +7801,7 @@ display_debug_str_offsets (struct dwarf_section *sect= ion, unsigned char *start =3D section->start; unsigned char *end =3D start + section->size; unsigned char *curr =3D start; + dwarf_vma debug_str_offsets_hdr_len; =20 const char *suffix =3D strrchr (section->name, '.'); bool dwo =3D suffix && strcmp (suffix, ".dwo") =3D=3D 0; @@ -7822,9 +7824,13 @@ display_debug_str_offsets (struct dwarf_section *sec= tion, { SAFE_BYTE_GET_AND_INC (length, curr, 8, end); entry_length =3D 8; + debug_str_offsets_hdr_len =3D 16; } else - entry_length =3D 4; + { + entry_length =3D 4; + debug_str_offsets_hdr_len =3D 8; + } =20 unsigned char *entries_end; if (length =3D=3D 0) @@ -7876,7 +7882,7 @@ display_debug_str_offsets (struct dwarf_section *sect= ion, SAFE_BYTE_GET_AND_INC (offset, curr, entry_length, entries_end); if (dwo) string =3D (const unsigned char *) - fetch_indexed_string (idx, NULL, entry_length, dwo, 0); + fetch_indexed_string (idx, NULL, entry_length, dwo, debug_str_offse= ts_hdr_len); else string =3D fetch_indirect_string (offset); =20 @@ -12013,7 +12019,7 @@ load_separate_debug_files (void * file, const char = * filename) printf (_(" Directory: %s\n"), dir ? dir : _("")); if (id !=3D NULL) display_data (printf (_(" ID: ")), (unsigned char *) id, 8); - else + else if (debug_information[0].dwarf_version !=3D 5) printf (_(" ID: \n")); printf ("\n\n"); }