Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH][gdb/symtab] Fix duplicate CUs in create_cus_from_debug_names_list
Date: Tue, 2 Feb 2021 12:35:14 +0100	[thread overview]
Message-ID: <20210202113513.GA10112@delia> (raw)

Hi,

When running test-case gdb.dwarf2/clang-debug-names.exp, I run into the
following warning:
...
(gdb) file clang-debug-names^M
Reading symbols from clang-debug-names...^M
warning: Section .debug_aranges in clang-debug-names has duplicate \
  debug_info_offset 0xc7, ignoring .debug_aranges.^M
...

This is caused by a missing return in commit 3ee6bb113af "[gdb/symtab] Fix
incomplete CU list assert in .debug_names".

Fix this by adding the missing return, such that we have instead this warning:
...
(gdb) file clang-debug-names^M
Reading symbols from clang-debug-names...^M
warning: Section .debug_aranges in clang-debug-names \
  entry at offset 0 debug_info_offset 0 does not exists, \
  ignoring .debug_aranges.^M
...
which is a known problem filed as PR25969 - "Ignoring .debug_aranges with
clang .debug_names".

Tested on x86_64-linux.

Any comments?

Thanks,
- Tom

[gdb/symtab] Fix duplicate CUs in create_cus_from_debug_names_list

gdb/ChangeLog:

2021-02-02  Tom de Vries  <tdevries@suse.de>

	PR symtab/27307
	* dwarf2/read.c (create_cus_from_debug_names_list): Add missing
	return.

gdb/testsuite/ChangeLog:

2021-02-02  Tom de Vries  <tdevries@suse.de>

	PR symtab/27307
	* gdb.dwarf2/clang-debug-names.exp: Check file command warnings.

---
 gdb/dwarf2/read.c                              |  1 +
 gdb/testsuite/gdb.dwarf2/clang-debug-names.exp | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 0a00f89cf6d..872b4e7bcf2 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -5323,6 +5323,7 @@ create_cus_from_debug_names_list (dwarf2_per_bfd *per_bfd,
 	  = create_cu_from_index_list (per_bfd, &section, is_dwz, sect_off, 0);
 	per_bfd->all_comp_units.push_back (per_cu);
       }
+      return;
     }
 
   sect_offset sect_off_prev;
diff --git a/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp b/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp
index 12134cf7f3e..5548b30e771 100644
--- a/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp
+++ b/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp
@@ -33,6 +33,22 @@ if { [prepare_for_testing "failed to prepare" ${testfile} \
     return -1
 }
 
+set test "no file command warnings"
+if { [regexp "warning: " $gdb_file_cmd_msg] } {
+    set kfail_re \
+	[concat \
+	     "warning: Section .debug_aranges in \[^\r\n\]* entry" \
+	     "at offset 0 debug_info_offset 0 does not exists," \
+	     "ignoring \\.debug_aranges\\."]
+    if { [regexp $kfail_re $gdb_file_cmd_msg] } {
+	kfail symtab/25969 $test
+    } else {
+	fail $test
+    }
+} else {
+    pass $test
+}
+
 set cmd "ptype main"
 set pass_re \
     [multi_line \

             reply	other threads:[~2021-02-02 11:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-02 11:35 Tom de Vries [this message]
2021-02-03 18:29 ` Simon Marchi via Gdb-patches
2021-02-05  8:21   ` Tom de Vries

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=20210202113513.GA10112@delia \
    --to=tdevries@suse.de \
    --cc=gdb-patches@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