From 57900be46f594ecfec9671124ab76775e5e8d960 Mon Sep 17 00:00:00 2001 From: "Gregory J. Ward" Date: Sat, 9 Nov 2024 00:10:49 +0000 Subject: [PATCH] fix: Changes to source-tracing requires child process restart --- src/rt/RtraceSimulManager.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/rt/RtraceSimulManager.cpp b/src/rt/RtraceSimulManager.cpp index 995a9d89..0e4a8476 100644 --- a/src/rt/RtraceSimulManager.cpp +++ b/src/rt/RtraceSimulManager.cpp @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: RtraceSimulManager.cpp,v 2.20 2024/11/07 18:37:11 greg Exp $"; +static const char RCSid[] = "$Id: RtraceSimulManager.cpp,v 2.21 2024/11/09 00:10:49 greg Exp $"; #endif /* * RtraceSimulManager.cpp @@ -288,7 +288,13 @@ RtraceSimulManager::UpdateMode() int misMatch = (rtFlags ^ curFlags) & RTmask; // updates based on toggled flags - if (misMatch & RTtraceSources) { + if (((misMatch & RTtraceSources) != 0) & (nsources > 0)) { + int nt = NThreads(); + if (nt > 1) { + if (FlushQueue() < 0) + return false; + SetThreadCount(1); + } int sn = nsources; if (rtFlags & RTtraceSources) { srcFollowed.NewBitMap(nsources); @@ -304,6 +310,7 @@ RtraceSimulManager::UpdateMode() source[sn].sflags &= ~SFOLLOW; srcFollowed.NewBitMap(0); } + if (nt > 1) SetThreadCount(nt); } if (misMatch & RTdoFIFO && FlushQueue() < 0) return false;