From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2fE5FdSSuGnFlSwAWB0awg (envelope-from ) for ; Mon, 16 Mar 2026 19:31:32 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=EqG8NHXR; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 522901E0BC; Mon, 16 Mar 2026 19:31:32 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 36FE61E08C for ; Mon, 16 Mar 2026 19:31:31 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 9AB334BA23E8 for ; Mon, 16 Mar 2026 23:31:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9AB334BA23E8 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=EqG8NHXR Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id CA3EF4BA23E8 for ; Mon, 16 Mar 2026 23:29:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CA3EF4BA23E8 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CA3EF4BA23E8 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773703770; cv=none; b=OW+L+RI7R3HDp3Ic25NswIapFges3udGyurQhkwFsxiGCqNy1Jgg1Wz+9SYSeh2lN7AYey4XGOBY7oH2v2ZQ8Mtquqf3iF49UmRshLkQBW5yPvK8M5BBua2o1wCt1ZiJS4oEeFgUlYKm1UZpy855a4ULMyegfilamHmPBLojhok= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1773703770; c=relaxed/simple; bh=YSSglbdcheU/d9uCe7NcQIqnPTuwFkDOuIcIQL3Jo84=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=H2pRJrVbEP1b3z0ELseQUMfvDYyG1bdIY7OSGRXAmKSIuH0Dk9+TP4DDsu7IX4BNKPJ6fIgvGON3EUBtK7NzZQ/3dvq6cg/05Mi1kv194VBi9lfcxmZSIEu61zFk6hpqOs+Zj4fEEUx8HYCttY8X1/3A6eAC4mrJXNc3WhULRx4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA3EF4BA23E8 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 62GNTNdk240304 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 Mar 2026 19:29:27 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 62GNTNdk240304 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=oct2025; t=1773703768; bh=0c6nON6yjYbCWVpRuPisDdam3FbxXRLHQSYXNbtWJsE=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=EqG8NHXRb9Dm5EVnU6DFRA00/Nb1f9F5lJM/H0E0zhheacc99j5iJAV/ajeVE6EEh PmSNhlh83dV328j7M2ydC963MdtYQ1iZ5pM/6ubOZZM9984bBxVu8z38tfbBmS4hks szNOiLaWnsI9PCQY/r9STH4eTriAurXN1PTjGZjiQMJSCnLjI3R+U5kldzlYhpyGMR uXu/HN7ZA9xNb6Dq3jp4vQoCi2IsLULHS/i9PZfvNsZG1/iO2b/9ReTt59siPhX6zT wpjaGsF8ed14OU6Nb3uCwBHjQPvL6zqGj2y1Mlc01OR8kmuAJx6/Z7Jr9As6Sixzhw g+LPGceVOwf3Q== Received: by simark.ca (Postfix) id DD5421E0DA; Mon, 16 Mar 2026 19:20:52 -0400 (EDT) From: simon.marchi@polymtl.ca To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 6/8] gdb/dwarf: add debug output in read-debug-names.c Date: Mon, 16 Mar 2026 19:19:24 -0400 Message-ID: <20260316232042.368080-7-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260316232042.368080-1-simon.marchi@polymtl.ca> References: <20260316232042.368080-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 16 Mar 2026 23:29:23 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org From: Simon Marchi Add a bunch of debug prints in read-debug-names.c to dump what we are reading. Some of if was helpful to me when debugging my changes to the .debug_names reader and writer. The debug prints are activated by "set debug dwarf-read" (I didn't feel like we needed a separate knob for that). There are two levels of verbosity. At level 1, we print everything that happens once, like the header, counts, offsets of important parts of the index, etc. At levels > 1, we print information about each abbrev, CU/TU and index entry. The output is made such that it is easy look at the output of readelf of llvm-dwarfdump on the side and confirm that GDB is reading the index right. Here are some examples of the output. Header and some abbrevs: [dwarf-read] read_debug_names_from_section: start: reading .debug_names from /home/simark/build/babeltrace/src/lib/.libs/libbabeltrace2.so.0.0.0 [dwarf-read] read_debug_names_from_section: section size: 0x19d4e, initial length: 0x19d4a, dwarf64: 0, offset_size: 4 [dwarf-read] read_debug_names_from_section: version: 5 [dwarf-read] read_debug_names_from_section: cu_count: 56, tu_count: 0, foreign_tu_count: 0 [dwarf-read] read_debug_names_from_section: bucket_count: 0, name_count: 3418, abbrev_table_size: 374, augmentation_string_size: 8 [dwarf-read] read_debug_names_from_section: augmentation string: "GDB3\x00\x00\x00\x00" [dwarf-read] read_debug_names_from_section: abbrev 1: tag DW_TAG_namespace, 4 attributes [dwarf-read] read_debug_names_from_section: DW_IDX_compile_unit DW_FORM_udata [dwarf-read] read_debug_names_from_section: DW_IDX_die_offset DW_FORM_ref_addr [dwarf-read] read_debug_names_from_section: DW_IDX_GNU_language DW_FORM_udata [dwarf-read] read_debug_names_from_section: DW_IDX_parent DW_FORM_data4 [dwarf-read] read_debug_names_from_section: abbrev 2: tag DW_TAG_enumerator, 4 attributes [dwarf-read] read_debug_names_from_section: DW_IDX_compile_unit DW_FORM_udata [dwarf-read] read_debug_names_from_section: DW_IDX_die_offset DW_FORM_ref_addr [dwarf-read] read_debug_names_from_section: DW_IDX_GNU_language DW_FORM_udata [dwarf-read] read_debug_names_from_section: DW_IDX_GNU_internal DW_FORM_flag_present Excerpt of the CU list: [dwarf-read] build_and_check_cu_list_from_debug_names: building CU list from .debug_names (56 CUs) [dwarf-read] build_and_check_cu_list_from_debug_names: CU 0: offset 0x0 [dwarf-read] build_and_check_cu_list_from_debug_names: CU 1: offset 0x1bac [dwarf-read] build_and_check_cu_list_from_debug_names: CU 2: offset 0x4262 [dwarf-read] build_and_check_cu_list_from_debug_names: CU 3: offset 0x4ff0 [dwarf-read] build_and_check_cu_list_from_debug_names: CU 4: offset 0x59e9 [dwarf-read] build_and_check_cu_list_from_debug_names: CU 5: offset 0x67af [dwarf-read] build_and_check_cu_list_from_debug_names: CU 6: offset 0x8e1a [dwarf-read] build_and_check_cu_list_from_debug_names: CU 7: offset 0xa5cc [dwarf-read] build_and_check_cu_list_from_debug_names: CU 8: offset 0xcd39 Some entries: [dwarf-read] scan_all_names: start: scanning 3418 names from .debug_names [dwarf-read] scan_entries: scanning entries for name 1: "(anonymous namespace)" (entry pool offset 0x0) [dwarf-read] scan_one_entry: entry pool offset 0x0: abbrev 1, tag DW_TAG_namespace [dwarf-read] scan_one_entry: DW_IDX_compile_unit (DW_FORM_udata): 55 [dwarf-read] scan_one_entry: DW_IDX_die_offset (DW_FORM_ref_addr): 0x7d06b [dwarf-read] scan_one_entry: DW_IDX_GNU_language (DW_FORM_udata): 33 [dwarf-read] scan_one_entry: DW_IDX_parent (DW_FORM_data4): 38201 [dwarf-read] scan_one_entry: -> die_offset 0x7d06b, per_cu offset 0x5af0e [dwarf-read] scan_one_entry: entry pool offset 0xb: end of entries (abbrev 0) [dwarf-read] scan_entries: scanning entries for name 2: "AUTO_SEEK_STREAM_STATE_PACKET_BEGAN" (entry pool offset 0xc) [dwarf-read] scan_one_entry: entry pool offset 0xc: abbrev 2, tag DW_TAG_enumerator [dwarf-read] scan_one_entry: DW_IDX_compile_unit (DW_FORM_udata): 17 [dwarf-read] scan_one_entry: DW_IDX_die_offset (DW_FORM_ref_addr): 0x1beea [dwarf-read] scan_one_entry: DW_IDX_GNU_language (DW_FORM_udata): 29 [dwarf-read] scan_one_entry: DW_IDX_GNU_internal (DW_FORM_flag_present): 1 [dwarf-read] scan_one_entry: -> die_offset 0x1beea, per_cu offset 0x1a28e [dwarf-read] scan_one_entry: entry pool offset 0x13: end of entries (abbrev 0) Change-Id: I4a40bfb73fa7feccb5038814a7d1a1bcd4f6231b --- gdb/dwarf2/read-debug-names.c | 120 +++++++++++++++++++++++++++++++++- gdb/dwarf2/read.c | 24 +------ gdb/dwarf2/read.h | 24 +++++++ 3 files changed, 143 insertions(+), 25 deletions(-) diff --git a/gdb/dwarf2/read-debug-names.c b/gdb/dwarf2/read-debug-names.c index 8e488377439b..6ac65d101b16 100644 --- a/gdb/dwarf2/read-debug-names.c +++ b/gdb/dwarf2/read-debug-names.c @@ -170,7 +170,12 @@ mapped_debug_names_reader::scan_one_entry (const char *name, const ULONGEST abbrev = read_unsigned_leb128 (abfd, entry, &bytes_read); entry += bytes_read; if (abbrev == 0) - return nullptr; + { + dwarf_read_debug_printf_v + (" entry pool offset 0x%tx: end of entries (abbrev 0)", + offset_in_entry_pool); + return nullptr; + } const auto indexval_it = abbrev_map.find (abbrev); if (indexval_it == abbrev_map.cend ()) @@ -182,6 +187,12 @@ mapped_debug_names_reader::scan_one_entry (const char *name, } const auto &indexval = indexval_it->second; + + dwarf_read_debug_printf_v + (" entry pool offset 0x%tx: abbrev %s, tag %s", + offset_in_entry_pool, pulongest (abbrev), + dwarf_tag_name (indexval.dwarf_tag)); + cooked_index_flag flags = 0; sect_offset die_offset {}; enum language lang = language_unknown; @@ -238,6 +249,14 @@ mapped_debug_names_reader::scan_one_entry (const char *name, bfd_get_filename (abfd))); return nullptr; } + + dwarf_read_debug_printf_v (" %s (%s): %s", + get_DW_IDX_name (attr.dw_idx), + dwarf_form_name (attr.form), + (attr.form == DW_FORM_ref_addr + ? hex_string (ull) + : pulongest (ull))); + switch (attr.dw_idx) { case DW_IDX_compile_unit: @@ -302,6 +321,11 @@ mapped_debug_names_reader::scan_one_entry (const char *name, /* Skip if we couldn't find a valid CU/TU index. */ if (per_cu != nullptr) { + dwarf_read_debug_printf_v + (" -> die_offset %s, per_cu offset %s", + sect_offset_str (die_offset), + sect_offset_str (per_cu->sect_off ())); + *result = indices[next_shard].add (die_offset, (dwarf_tag) indexval.dwarf_tag, flags, lang, name, nullptr, per_cu); @@ -312,6 +336,8 @@ mapped_debug_names_reader::scan_one_entry (const char *name, entry_pool_offsets_to_entries.emplace (offset_in_entry_pool, *result); } + else + dwarf_read_debug_printf_v (" -> no valid CU/TU, skipping"); return entry; } @@ -323,6 +349,12 @@ mapped_debug_names_reader::scan_entries (uint32_t index, const char *name, const gdb_byte *entry) { + /* Print a 1-based index, because this is what readelf and llvm-dwarfdump + do. This makes it easier to compare output side-by-side. */ + dwarf_read_debug_printf_v + ("scanning entries for name %u: \"%s\" (entry pool offset 0x%tx)", + index + 1, name, entry - entry_pool); + std::vector these_entries; while (true) @@ -347,6 +379,9 @@ mapped_debug_names_reader::scan_entries (uint32_t index, void mapped_debug_names_reader::scan_all_names () { + DWARF_READ_SCOPED_DEBUG_START_END + ("scanning %u names from .debug_names", name_count); + all_entries.resize (name_count); /* In the first pass, create all the entries. */ @@ -377,6 +412,9 @@ mapped_debug_names_reader::scan_all_names () Otherwise, the DW_IDX_parent value is an offset into the entry pool, which is not ambiguous. */ + dwarf_read_debug_printf ("resolving %zu parent pointers", + needs_parent.size ()); + for (auto &[entry, parent_val] : needs_parent) { if (augmentation_is_gdb && gdb_augmentation_version == 2) @@ -463,6 +501,9 @@ build_and_check_tu_list_from_debug_names (dwarf2_per_objfile *per_objfile, mapped_debug_names_reader &map, dwarf2_section_info *section) { + dwarf_read_debug_printf ("building TU list from .debug_names (%u TUs)", + map.tu_count); + struct objfile *objfile = per_objfile->objfile; dwarf2_per_bfd *per_bfd = per_objfile->per_bfd; @@ -477,6 +518,9 @@ build_and_check_tu_list_from_debug_names (dwarf2_per_objfile *per_objfile, map.offset_size, map.dwarf5_byte_order)); + dwarf_read_debug_printf_v (" TU %u: offset %s", i, + sect_offset_str (sect_off)); + /* Find the matching dwarf2_per_cu. */ dwarf2_per_cu *per_cu = dwarf2_find_unit ({ section, sect_off }, per_bfd); @@ -508,15 +552,24 @@ read_debug_names_from_section (dwarf2_per_objfile *per_objfile, struct dwarf2_section_info *section, mapped_debug_names_reader &map) { + DWARF_READ_SCOPED_DEBUG_START_END + ("reading .debug_names from %s", filename); + struct objfile *objfile = per_objfile->objfile; if (section->empty ()) - return false; + { + dwarf_read_debug_printf ("section is empty"); + return false; + } /* Older elfutils strip versions could keep the section in the main executable while splitting it for the separate debug info file. */ if ((section->get_flags () & SEC_HAS_CONTENTS) == 0) - return false; + { + dwarf_read_debug_printf ("section has no contents"); + return false; + } section->read (objfile); @@ -534,6 +587,11 @@ read_debug_names_from_section (dwarf2_per_objfile *per_objfile, map.dwarf5_is_dwarf64 = bytes_read != 4; map.offset_size = map.dwarf5_is_dwarf64 ? 8 : 4; + + dwarf_read_debug_printf ("section size: %s, initial length: %s, " + "dwarf64: %d, offset_size: %d", + hex_string (section->size), hex_string (length), + map.dwarf5_is_dwarf64, map.offset_size); if (bytes_read + length != section->size) { /* There may be multiple per-CU indices. */ @@ -549,6 +607,9 @@ read_debug_names_from_section (dwarf2_per_objfile *per_objfile, /* The version number. */ uint16_t version = read_2_bytes (abfd, addr); addr += 2; + + dwarf_read_debug_printf ("version: %d", version); + if (version != 5) { warning (_("Section .debug_names in %ps has unsupported version %d, " @@ -585,6 +646,11 @@ read_debug_names_from_section (dwarf2_per_objfile *per_objfile, list. */ uint32_t foreign_tu_count = read_4_bytes (abfd, addr); addr += 4; + + dwarf_read_debug_printf ("cu_count: %u, tu_count: %u, " + "foreign_tu_count: %u", + map.cu_count, map.tu_count, foreign_tu_count); + if (foreign_tu_count != 0) { warning (_("Section .debug_names in %ps has unsupported %lu foreign TUs, " @@ -613,11 +679,34 @@ read_debug_names_from_section (dwarf2_per_objfile *per_objfile, string. This value is rounded up to a multiple of 4. */ uint32_t augmentation_string_size = read_4_bytes (abfd, addr); addr += 4; + + dwarf_read_debug_printf ("bucket_count: %u, name_count: %u, " + "abbrev_table_size: %u, " + "augmentation_string_size: %u", + map.bucket_count, map.name_count, + abbrev_table_size, augmentation_string_size); + augmentation_string_size += (-augmentation_string_size) & 3; const auto augmentation_string = gdb::make_array_view (addr, augmentation_string_size); + if (dwarf_read_debug >= 1) + { + std::string aug_repr; + for (size_t i = 0; i < augmentation_string_size; i++) + { + gdb_byte b = addr[i]; + if (c_isprint (b)) + aug_repr += b; + else + aug_repr += string_printf ("\\x%02x", b); + } + + dwarf_read_debug_printf ("augmentation string: \"%s\"", + aug_repr.c_str ()); + } + if (augmentation_string == gdb::make_array_view (dwarf5_augmentation_1)) { warning (_(".debug_names created by an old version of gdb; ignoring")); @@ -704,7 +793,26 @@ read_debug_names_from_section (dwarf2_per_objfile *per_objfile, break; indexval.attr_vec.push_back (std::move (attr)); } + + dwarf_read_debug_printf_v + (" abbrev %s: tag %s, %zu attributes", + pulongest (index_num), dwarf_tag_name (indexval.dwarf_tag), + indexval.attr_vec.size ()); + + for (const auto &attr : indexval.attr_vec) + dwarf_read_debug_printf_v + (" %s %s%s", + get_DW_IDX_name (attr.dw_idx), + dwarf_form_name (attr.form), + (attr.form == DW_FORM_implicit_const + ? string_printf (" (%s)", + plongest (attr.implicit_const)).c_str () + : "")); } + + dwarf_read_debug_printf ("%zu abbreviations read", + map.abbrev_map.size ()); + if (addr != abbrev_table_start + abbrev_table_size) { warning (_("Section .debug_names in %ps has abbreviation_table " @@ -728,6 +836,9 @@ build_and_check_cu_list_from_debug_names (dwarf2_per_bfd *per_bfd, mapped_debug_names_reader &map, dwarf2_section_info §ion) { + dwarf_read_debug_printf ("building CU list from .debug_names (%u CUs)", + map.cu_count); + int nr_cus = per_bfd->num_comp_units; if (map.cu_count != nr_cus) @@ -745,6 +856,9 @@ build_and_check_cu_list_from_debug_names (dwarf2_per_bfd *per_bfd, map.offset_size, map.dwarf5_byte_order)); + dwarf_read_debug_printf_v (" CU %u: offset %s", i, + sect_offset_str (sect_off)); + /* Find the matching dwarf2_per_cu. */ dwarf2_per_cu *per_cu = dwarf2_find_unit ({ §ion, sect_off }, per_bfd); diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index af7ef8d8f3db..c58cc1731f47 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -99,28 +99,8 @@ #include "extract-store-integer.h" #include "cli/cli-style.h" -/* When == 1, print basic high level tracing messages. - When > 1, be more verbose. - This is in contrast to the low level DIE reading of dwarf_die_debug. */ -static unsigned int dwarf_read_debug = 0; - -/* Print a "dwarf-read" debug statement if dwarf_read_debug is >= 1. */ - -#define dwarf_read_debug_printf(fmt, ...) \ - debug_prefixed_printf_cond (dwarf_read_debug >= 1, "dwarf-read", fmt, \ - ##__VA_ARGS__) - -/* Print a "dwarf-read" debug statement if dwarf_read_debug is >= 2. */ - -#define dwarf_read_debug_printf_v(fmt, ...) \ - debug_prefixed_printf_cond (dwarf_read_debug >= 2, "dwarf-read", fmt, \ - ##__VA_ARGS__) - -/* Print "dwarf-read" start/end debug statements. */ - -#define DWARF_READ_SCOPED_DEBUG_START_END(fmt, ...) \ - scoped_debug_start_end ([] { return dwarf_read_debug >= 1; }, "dwarf-read", \ - fmt, ##__VA_ARGS__) +/* See read.h. */ +unsigned int dwarf_read_debug = 0; /* When non-zero, dump DIEs after they are read in. */ static unsigned int dwarf_die_debug = 0; diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h index 1687bc52e432..e4ed84b08ad9 100644 --- a/gdb/dwarf2/read.h +++ b/gdb/dwarf2/read.h @@ -1344,6 +1344,30 @@ type *dwarf2_fetch_die_type_sect_off (sect_offset sect_off, dwarf2_per_objfile *per_objfile, const char **var_name = nullptr); +/* When == 1, print basic high level tracing messages. + When > 1, be more verbose. + This is in contrast to the low level DIE reading of dwarf_die_debug. */ + +extern unsigned int dwarf_read_debug; + +/* Print a "dwarf-read" debug statement if dwarf_read_debug is >= 1. */ + +#define dwarf_read_debug_printf(fmt, ...) \ + debug_prefixed_printf_cond (dwarf_read_debug >= 1, "dwarf-read", fmt, \ + ##__VA_ARGS__) + +/* Print a "dwarf-read" debug statement if dwarf_read_debug is >= 2. */ + +#define dwarf_read_debug_printf_v(fmt, ...) \ + debug_prefixed_printf_cond (dwarf_read_debug >= 2, "dwarf-read", fmt, \ + ##__VA_ARGS__) + +/* Print "dwarf-read" start/end debug statements. */ + +#define DWARF_READ_SCOPED_DEBUG_START_END(fmt, ...) \ + scoped_debug_start_end ([] { return dwarf_read_debug >= 1; }, "dwarf-read", \ + fmt, ##__VA_ARGS__) + /* When non-zero, dump line number entries as they are read in. */ extern unsigned int dwarf_line_debug; -- 2.53.0