From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E31733858433; Wed, 5 Jan 2022 20:31:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E31733858433 From: "blarsen at redhat dot com" To: gdb-prs@sourceware.org Subject: [Bug c++/17315] 'until' behavion in watchpoint.c (for loops) incompatible with loop condition instructions at the top of the loop Date: Wed, 05 Jan 2022 20:31:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: c++ X-Bugzilla-Version: 7.7 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: blarsen at redhat dot com X-Bugzilla-Status: ASSIGNED 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_status cc Message-ID: In-Reply-To: References: 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: Wed, 05 Jan 2022 20:31:11 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D17315 B. Larsen changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED CC| |blarsen at redhat dot com --- Comment #3 from B. Larsen --- I believe I have a solution for this problem. The issue wasn't that the loop condition was at the top, but rather that there were lines at the bottom th= at weren't marked as is_stmt.=20 This way, when calculating the maximum PC to execute to, it landed on that !is_stmt instruction, assumed the inferior was out of the block and GDB sto= pped at the next is_stmt instruction, the one inside the loop My patch fixes this by searching the first instance of an is_stmt instructi= on, or the first instruction that happens on a different line, and sets that as= the stopping PC The patch is available here: https://sourceware.org/pipermail/gdb-patches/2022-January/184799.html --=20 You are receiving this mail because: You are on the CC list for the bug.=