]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/amd-dbgapi: add assert in require_forward_progress
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 9 Jun 2025 16:08:58 +0000 (12:08 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 16 Jun 2025 14:14:14 +0000 (10:14 -0400)
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 <lancelot.six@amd.com>
gdb/amd-dbgapi-target.c

index 2aa9d2a03a4b31555dcb0e6b537382e77a9dda7b..32a3f6d3c334f36e5adfa0f6747d1940f7a056f9 100644 (file)
@@ -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 ())