* [PING 2][PATCH 1/1] gdb, infcall, breakpoint: Handle cycles in conditional expr evaluation
@ 2026-10-27 9:00 Bouhaouel, Mohamed
0 siblings, 0 replies; only message in thread
From: Bouhaouel, Mohamed @ 2026-10-27 9:00 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 2332 bytes --]
Kindly pinging.
Thanks!
--Mohamed
________________________________
From: Mohamed Bouhaouel
Sent: Friday, October 2, 2026 4:35 PM
To: gdb-patches@sourceware.org
Cc: abdul.b.ijaz@intel.com; mohamed.bouhaouel@intel.com
Subject: Re: [PATCH 1/1] gdb, infcall, breakpoint: Handle cycles in conditional expr evaluation
Take the following scenario: (gdb) break foo if foo (1) == 2 (gdb) run The program stops at 'foo', then GDB tries to evaluate the condition. The condition triggers an inferior call of 'foo', which causes a stop at 'foo' again, and GDB is stuck in this infinite cycle. The same issue exists also for indirect cycles, e.g., (gdb) break foo if bar (1) (gdb) break bar if foo (1) (gdb) run To avoid this, check for cycles just before evaluating a breakpoint condition. If a breakpoint is hit again while its own condition is being evaluated, the evaluation of that condition is aborted with an error message. With the patch, the behavior becomes: (gdb) break foo if foo (1) == 2 Breakpoint 2 at 0x55555555514c: file infcall-from-bp-cond-cycle.c, line 27. (gdb) continue Continuing. Error in testing condition for breakpoint 2: Aborting expression evaluation for the conditional bp: A cycle was detected during the evaluation. Breakpoint 2, foo (a=1) at infcall-from-bp-cond-cycle.c:27 27 return a + add_one (a); Error in testing condition for breakpoint 2: The program being debugged stopped while in a function called from GDB. Evaluation of the expression containing the function (foo) will be abandoned. When the function is done executing, GDB will silently stop. (gdb) backtrace #0 foo (a=1) at infcall-from-bp-cond-cycle.c:27 #1
________________________________________
Intel Deutschland GmbH
Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany
Tel: +49 (89) 99143-0
www.intel.de
Managing Directors: Candice Moore, Jeffrey Schneiderman, Ramachandran Sitaraman
Chairperson of the Supervisory Board: Sonja Pierer
Registered Seat: Munich Commercial Register B: Amtsgericht Munich HRB 186928
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
[-- Attachment #2: Type: text/html, Size: 5514 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-27 9:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-27 9:00 [PING 2][PATCH 1/1] gdb, infcall, breakpoint: Handle cycles in conditional expr evaluation Bouhaouel, Mohamed
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox