From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B014F385C301; Fri, 8 Mar 2024 09:54:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B014F385C301 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1709891656; bh=xmgcGmRLR/CsMYDTQnwCFS5cFVcyxa7qj7Vy0DZ8aEI=; h=From:To:Subject:Date:From; b=o0b4RmIqs8H7yNftymAWTybcS48sTBm/ADsuN9z4sywc3fTPUIXUNr1iLBSPgj+md yRz/Z6B5kc4v4MZe0KVmtRa/+E4ZaX7Yu2LOYNxOyYOWLjJgeIh+02CqBb97V6TmSB ujr8onraQ0DYkPAKeW3OMDW7ziUep0lMErFW6ao4= From: "dmitry.neverov at jetbrains dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/31463] New: Artificial variables in locals output Date: Fri, 08 Mar 2024 09:54:14 +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: 14.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dmitry.neverov at jetbrains 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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31463 Bug ID: 31463 Summary: Artificial variables in locals output Product: gdb Version: 14.1 Status: UNCONFIRMED Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: dmitry.neverov at jetbrains dot com Target Milestone: --- To reproduce compile the program (g++ -g -o main main.cpp): #include #include int main() { std::vector v =3D {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; for (auto i : v) { std::cout << i << std::endl; } return 0; } Run gdb:=20 $ gdb -q -batch main -ex "b main.cpp:7" -ex "run" -ex "info locals" The output contains artificial symbols __for_range, __for_begin, __for_end: Breakpoint 1, main () at main.cpp:7 7 std::cout << i << std::endl; i =3D 1 __for_range =3D std::vector of length 10, capacity 10 =3D {1, 2, 3, 4, 5, 6= , 7, 8, 9, 10} __for_begin =3D 1 __for_end =3D 60721 v =3D std::vector of length 10, capacity 10 =3D {1, 2, 3, 4, 5, 6, 7, 8, 9,= 10} These symbols also returned when iterating over a block in python, and is_artificial is not exposed in python API. This was fixed for Ada, but not other languages in https://sourceware.org/bugzilla/show_bug.cgi?id=3D28180. I've noticed, that in python such symbols have the line=3D0. Is it correct to use this as a sign that the symbol is artificial? --=20 You are receiving this mail because: You are on the CC list for the bug.=