From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ADD1D3858D39; Thu, 18 May 2023 19:29:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ADD1D3858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684438141; bh=qLVdHpu4hQPTnHXSVXy0ssg3tOAhgDyrA7cDiTZWd9k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TPZkkqU4RbZZ8T1FYLPmx+szxFW8pKI1QmfGqkmBvfI4R86DDGzG9gK9KROWiCprc lp932dU3NeeCHmQ9F79w54W2v/C5oGYwf5gdS/sQrBNQTFNLIaNanDxcWgenP8eX2a LJAyfifEzS2a9TpBfEgr1/fBtG4uXvoREiApqaik= From: "simon.farre.cx at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/109902] gcc/g++ emits wrong column number in DWARF Date: Thu, 18 May 2023 19:29:01 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 12.3.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simon.farre.cx at gmail dot com 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: Message-ID: In-Reply-To: References: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109902 --- Comment #1 from Simon Farre --- This is slightly off-topic, but still relevant to this discussion. In the attachment, we can see this line " const auto res3 =3D b.set_foo (next_v ()).set_bar (next_v ()).set_baz (n= ext_v ()).finalize ([] (auto v) { return v * 3; });" -- GCC -- Address Line Column File ISA Discriminator Flags ------------------ ------ ------ ------ --- ------------- ------------- 0x00000000004011ee 68 31 1 0 0 is_stmt 0x0000000000401206 68 51 1 0 0 is_stmt 0x0000000000401218 68 71 1 0 0 is_stmt 0x0000000000401227 68 92 1 0 0 is_stmt 0x00000000004012ee 68 93 1 0 0 is_stmt 0x00000000004012f9 68 118 1 0 0 is_stmt 0x0000000000401302 68 121 1 0 0 is_stmt where as clang outputs: Address Line Column File ISA Discriminator Flags ------------------ ------ ------ ------ --- ------------- ------------- 0x00000000004011fd 68 32 1 0 0 is_stmt 0x000000000040120b 68 23 1 0 0 0x0000000000401217 68 52 1 0 0 0x0000000000401225 68 43 1 0 0 0x0000000000401231 68 72 1 0 0 0x000000000040123f 68 63 1 0 0 0x0000000000401247 68 83 1 0 0 0x0000000000401450 68 0 1 0 0 is_stmt 0x000000000040145b 68 116 1 0 0 is_stmt prologue= _end 0x000000000040145f 68 107 1 0 0 0x0000000000401461 68 107 1 0 0 end_sequence As we can see, clang outputs information to the actual column meta data for calls at parameter sites whereas GCC does not. Providing these positions in source code opens up for "ergonomics-features", particularly in GDB as GDB = can more easily determine sites of interest to step to, set breakpoints at, etc= .=