From: Simon Marchi Date: Mon, 9 Jun 2025 16:08:58 +0000 (-0400) Subject: gdb/amd-dbgapi: add assert in require_forward_progress X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5ac1c64c0408b038cc4ec07b955b5b2fc3a2e57a;p=thirdparty%2Fbinutils-gdb.git gdb/amd-dbgapi: add assert in require_forward_progress I didn't have a problem in this area, but it seems to me that this pre-condition should always hold. We should only disable forward progress requirement if the target says it's ok to do so. Otherwise, we could get in a situation where we wait for events from amd-dbgapi, which will never arrive, because amd-dbgapi didn't actually resume things. Change-Id: Ifc49f55c7874924b7c47888b8391a07a01d960fc Approved-by: Lancelot Six --- diff --git a/gdb/amd-dbgapi-target.c b/gdb/amd-dbgapi-target.c index 2aa9d2a03a4..32a3f6d3c33 100644 --- a/gdb/amd-dbgapi-target.c +++ b/gdb/amd-dbgapi-target.c @@ -450,6 +450,12 @@ static void require_forward_progress (ptid_t ptid, process_stratum_target *proc_target, bool require) { + /* If we try to disable forward progress requirement but the target expects + resumed threads to be committed to the target, we could wait for events + that will never arrive. */ + if (!require) + gdb_assert (!proc_target->commit_resumed_state); + for (inferior *inf : all_inferiors (proc_target)) { if (ptid != minus_one_ptid && inf->pid != ptid.pid ())