From: "Bouhaouel, Mohamed" <mohamed.bouhaouel@intel.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: [PING 2][PATCH 1/1] gdb, infcall, breakpoint: Handle cycles in conditional expr evaluation
Date: Tue, 27 Oct 2026 09:00:37 +0000 [thread overview]
Message-ID: <SA1PR11MB6968393842965F358AEF755DE4602@SA1PR11MB6968.namprd11.prod.outlook.com> (raw)
[-- 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 --]
reply other threads:[~2026-10-27 9:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=SA1PR11MB6968393842965F358AEF755DE4602@SA1PR11MB6968.namprd11.prod.outlook.com \
--to=mohamed.bouhaouel@intel.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox