From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH 09/11] [gdb/macros] Fix gdb.base/fission-macro.exp with clang
Date: Tue, 21 May 2024 17:44:13 +0200 [thread overview]
Message-ID: <20240521154415.9543-9-tdevries@suse.de> (raw)
In-Reply-To: <20240521154415.9543-1-tdevries@suse.de>
When running test-case gdb.base/fission-macro.exp with clang, we run into:
...
(gdb) info macro FIFTH^M
Defined at $build/gdb/testsuite/<bad macro file number 2>:18^M
included at $src/gdb/testsuite/gdb.base/fission-macro.c:21^M
(gdb) FAIL: gdb.base/fission-macro.exp: dwarf_version=4: dwarf_bits=32: \
strict_dwarf=0: info macro FIFTH
...
This is caused by the fact that the .debug_macros.dwo section refers to the
.debug_line.dwo section, but the .debug_line section is used instead.
Fix this by making sure the .debug_line.dwo section is used.
PR macros/31750
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31750
---
gdb/dwarf2/read.c | 16 ++++++++++++++++
gdb/testsuite/gdb.base/fission-macro.exp | 6 ++++--
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 6a489502f8b..b742f38c303 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -21224,6 +21224,7 @@ dwarf_decode_macros (struct dwarf2_cu *cu, unsigned int offset,
struct dwarf2_section_info *section;
const char *section_name;
+ line_header_up lh_up;
if (cu->dwo_unit != nullptr)
{
if (section_is_gnu)
@@ -21236,6 +21237,21 @@ dwarf_decode_macros (struct dwarf2_cu *cu, unsigned int offset,
section = &cu->dwo_unit->dwo_file->sections.macinfo;
section_name = ".debug_macinfo.dwo";
}
+
+ {
+ struct dwarf2_section_info *line_section;
+
+ line_section = &cu->dwo_unit->dwo_file->sections.line;
+ line_section->read (per_objfile->objfile);
+ if (line_section->buffer == NULL)
+ {
+ complaint (_("missing .debug_line.dwo section"));
+ return;
+ }
+ lh_up = dwarf_decode_line_header ((sect_offset)0, 0, per_objfile,
+ line_section, &cu->header, nullptr);
+ lh = lh_up.get ();
+ }
}
else
{
diff --git a/gdb/testsuite/gdb.base/fission-macro.exp b/gdb/testsuite/gdb.base/fission-macro.exp
index 5474baf21d5..de1ce7d3823 100644
--- a/gdb/testsuite/gdb.base/fission-macro.exp
+++ b/gdb/testsuite/gdb.base/fission-macro.exp
@@ -13,8 +13,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. */
-# Gcc 14 is the first release containing the fix for PR debug/111409.
-require {expr [gcc_major_version] >= 14}
+if { [test_compiler_info "gcc-*"] } {
+ # Gcc 14 is the first release containing the fix for PR debug/111409.
+ require {expr [gcc_major_version] >= 14}
+}
standard_testfile .c -2.c .h
--
2.35.3
next prev parent reply other threads:[~2024-05-21 15:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-21 15:44 [PATCH 01/11] [gdb/testsuite] Add gdb.base/fission-macro.exp Tom de Vries
2024-05-21 15:44 ` [PATCH 02/11] [gdb/macros] Handle 64-bit dwarf in gdb.base/fission-macro.exp Tom de Vries
2024-05-21 15:44 ` [PATCH 03/11] [gdb/testsuite] Add test-case gdb.base/fission-macro-i.exp Tom de Vries
2024-06-13 16:27 ` Tom de Vries
2024-05-21 15:44 ` [PATCH 04/11] [gdb/macros] Work around gcc PR debug/99319 Tom de Vries
2024-05-21 15:44 ` [PATCH 05/11] [gdb/macros] Work around a gcc PR fixed in gcc 9 Tom de Vries
2024-05-21 15:44 ` [PATCH 06/11] [gdb/macros] Handle v4 dwarf in gdb.base/fission-macro.exp Tom de Vries
2024-05-21 15:44 ` [PATCH 07/11] [gdb/macros] Workaround gcc PR debug/115066 Tom de Vries
2024-05-21 15:44 ` [PATCH 08/11] [gdb/testsuite] Extend gdb.base/fission-macro.exp Tom de Vries
2024-05-21 15:44 ` Tom de Vries [this message]
2024-05-21 15:44 ` [PATCH 10/11] [gdb/testsuite] Use -g3 in gdb.base/lineinc.exp Tom de Vries
2024-05-21 15:44 ` [PATCH 11/11] [gdb/testsuite] Don't use readelf in gdb/contrib/cc-with-tweaks.sh Tom de Vries
2024-06-13 15:40 ` [PATCH 01/11] [gdb/testsuite] Add gdb.base/fission-macro.exp Tom de Vries
2024-06-17 8:16 ` Christophe Lyon
2024-06-17 8:23 ` Tom de Vries
2024-06-17 8:43 ` Christophe Lyon
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=20240521154415.9543-9-tdevries@suse.de \
--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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).