From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B87933865479; Tue, 8 Jun 2021 07:24:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B87933865479 From: "sourav0311 at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/27966] New: macro tests failing when using -gdwarf-5 -gsplit-dwarf Date: Tue, 08 Jun 2021 07:24:11 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sourav0311 at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2021 07:24:11 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27966 Bug ID: 27966 Summary: macro tests failing when using -gdwarf-5 -gsplit-dwarf Product: gdb Version: HEAD Status: UNCONFIRMED Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: sourav0311 at gmail dot com Target Milestone: --- Compiler used: CLANG trunk GDB Version: trunk (GNU gdb (GDB) 11.0.50.20210606-git) ``` make check TESTS=3Dgdb.base/macscp.exp RUNTESTFLAGS=3D'"CC_FOR_TARGET=3Dcla= ng" CFLAGS_FOR_TARGET=3D"-gdwarf-5 -gsplit-dwarf"' =3D=3D=3D gdb Summary =3D=3D=3D # of expected passes 234 # of unexpected failures 65 # of known failures 40 65 tests case failed while 234 testcases passing, this suggests some part of "-gsplit-dwarf" and macro machinery is still working great :) For a typical case one can observe the macro visible inside GDB: $ clang -fdebug-macro -gdwarf-5 -gsplit-dwarf ./macro.c ... gdb a.out -q Reading symbols from a.out... (gdb) start Temporary breakpoint 1 at 0x201664: file ./macro.c, line 2. Starting program: /home/sourabh/work/dwarf/c_c++/a.out Temporary breakpoint 1, main () at ./macro.c:2 2 int main() {} (gdb) info macros Defined at /home/sourabh/work/dwarf/c_c++/./macro.c:1 #define HELLO_GDB 1 Defined at /home/sourabh/work/dwarf/c_c++/./macro.c:-1 #define __FILE__ "/home/sourabh/work/dwarf/c_c++/./macro.c" Defined at /home/sourabh/work/dwarf/c_c++/./macro.c:-1 #define __LINE__ 2 ... Coming to 65 failures observed: We observed that, GDB doesn't reads the specialized line table from `.debug_line.dwo` section. Looking at the source code it seems to me that t= his is on purpose and `.debug_line.dwo` is only read if type units are present Code snippet from dwarf2/read.c ``` get_debug_line_section (struct dwarf2_cu *cu) /* For TUs in DWO files, the DW_AT_stmt_list attribute lives in the DWO file. */ if (cu->dwo_unit && cu->per_cu->is_debug_types) ``` Please note that `clang` emits specialized line table `.debug_line.dwo` for= 2 cases: 1. For if type units are present (As per DWARFv5 spec) 2. For if `.debug_macro.dwo` section is present. DWARFIssue file to capture this http://dwarfstd.org/ShowIssue.php?issue=3D200602.1 **NOTE**:=20 *Non-absolute/Relative* path still does not work(both split & no-split case) yet :( Patch in progress, needs clarification on the approach from maintainers. https://sourceware.org/pipermail/gdb-patches/2021-May/179190.html i.e ``` $ clang -fdebug-macro -gdwarf-5 -gsplit-dwarf macro.c gdb a.out -q Reading symbols from a.out... (gdb) start Temporary breakpoint 1 at 0x201664: file macro.c, line 2. Starting program: /home/sourabh/work/dwarf/c_c++/a.out Temporary breakpoint 1, main () at macro.c:2 2 int main() {} (gdb) info macros ``` --=20 You are receiving this mail because: You are on the CC list for the bug.=