From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EAED53858D35; Tue, 31 Jan 2023 11:40:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EAED53858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675165241; bh=M1GbmYXyQ/aH21q9kIfk6G8TRXXfKLJlrMOXpsRKqiI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dq1T8ZLsFz/hrxdbtFq0A37esyQq6amefsg9e7sWuViXQqd3jHxbHBJT4r9xp2r8E MTquPsvFusdcdi+KSxVhNHZ/eLhL0Misl30MnZ9Qch6HWCy6w53NZLIxl2xwt8e1Si yaKi6W55+5ZuKRr7IuagQ7nHKEvPDTpezCR4s+VA= From: "luis.machado at arm dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/21221] gdb hangs while stepping an empty loop Date: Tue, 31 Jan 2023 11:40:41 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: luis.machado at arm 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: 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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D21221 --- Comment #17 from Luis Machado --- (In reply to kristof mulier from comment #16) > Hi @Luis, > Thanks for your quick reply! > We have this problem with GCC, that's what we are using. Here is an examp= le > of the loop code: >=20 > void delay_1ms(uint32_t count) > { > delay =3D count; >=20 > while(0U !=3D delay){ > } // <- this loop causes the problem > } Right. That while case *should* be a case where we can handle things in a s= ane way if there are more than a single instruction. I believe clang might gene= rate code that doesn't cause gdb to get stuck. gcc is a different matter though. Last time I was investigating this, gcc u= sed to get rid of opening/closing brace line entries, whereas clang doesn't. The opening/closing brace is something compilers can use to generate a line ent= ry, which gdb would like to see for a step/next command. Handling these cases (they are a set of multiple corner cases depending on = how you write your code) in gdb is not trivial unfortunately. --=20 You are receiving this mail because: You are on the CC list for the bug.=