From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BD3ED3886C65; Fri, 23 Jul 2021 12:35:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD3ED3886C65 From: "vries at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/101598] New: [debug, ada] .loc generated for defs__struct1IP Date: Fri, 23 Jul 2021 12:35:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.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://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 12:35:59 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101598 Bug ID: 101598 Summary: [debug, ada] .loc generated for defs__struct1IP Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: vries at gcc dot gnu.org Target Milestone: --- I. Consider test-case defs.adb/defs.ads from a gdb testcase ( https://sourceware.org/git/?p=3Dbinutils-gdb.git;a=3Dtree;f=3Dgdb/testsuite= /gdb.ada/formatted_ref ). When compiled with trunk, we have a .loc in defs__struct1IP: ... $ ./install/bin/gcc defs.adb -c -save-temps -g $ more defs.s .file "defs.adb" .text .Ltext0: .file 0 "/home/vries/gcc_versions/devel" "defs.adb" .align 2 .globl defs__struct1IP .type defs__struct1IP, @function defs__struct1IP: .LFB2: .cfi_startproc .file 1 "defs.ads" .loc 1 18 9 pushq %rbp ... According to PR 101575 comment 7, that's something that needs to be fixed. II. Concretely, the .loc being there means that when stepping through defs___el= abs, we'll step into defs__struct1IP: ... $ gdb -q formatted_ref -ex "b defs___elabs" -ex run Reading symbols from formatted_ref... Breakpoint 1 at 0x402bfe: file defs.ads, line 25. Starting program: formatted_ref=20 Breakpoint 1, () at defs.ads:25 25 S1 : Struct1; (gdb) s 0x0000000000402bcc in defs__struct1IP () at defs.ads:18 18 type Struct1 is limited record (gdb) s () at defs.ads:27 27 end Defs; (gdb)=20 ... OTOH, with gcc-11, we have no .loc: ... $ gcc-11 defs.adb -c -save-temps -g -gdwarf-5 $ more defs.s .file "defs.adb" .text .Ltext0: .file 0 "/home/vries/gcc_versions/devel" "defs.adb" .align 2 .globl defs__struct1IP .type defs__struct1IP, @function defs__struct1IP: .LFB2: .cfi_startproc pushq %rbp ... which means means we don't step into defs__struct1IP: ... $ gdb -q formatted_ref -ex "b defs___elabs" -ex run Reading symbols from formatted_ref... Breakpoint 1 at 0x402d1a: file defs.ads, line 25. Starting program: formatted_ref=20 Breakpoint 1, () at defs.ads:25 25 S1 : Struct1; (gdb) s 27 end Defs; (gdb)=20 ... III. The difference is caused by commit e69ac020372 ("Add line debug info for virtual thunks").=