aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2025-06-09 12:08:58 -0400
committerSimon Marchi <simon.marchi@efficios.com>2025-06-16 10:14:14 -0400
commit5ac1c64c0408b038cc4ec07b955b5b2fc3a2e57a (patch)
tree7207ef3394c9de7aa0d08cad468c6598341191e8 /gdb
parenta421b077b2522040aecc65c0b9cb336a63e208d3 (diff)
downloadgdb-5ac1c64c0408b038cc4ec07b955b5b2fc3a2e57a.zip
gdb-5ac1c64c0408b038cc4ec07b955b5b2fc3a2e57a.tar.gz
gdb-5ac1c64c0408b038cc4ec07b955b5b2fc3a2e57a.tar.bz2
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 <lancelot.six@amd.com>
Diffstat (limited to 'gdb')
-rw-r--r--gdb/amd-dbgapi-target.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/amd-dbgapi-target.c b/gdb/amd-dbgapi-target.c
index 2aa9d2a..32a3f6d 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 ())