Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/44612 )

Change subject: base: Don't wait for an inactive CPU for remote GDB.
......................................................................

base: Don't wait for an inactive CPU for remote GDB.

When connecting to a thread, the remote GDB stub will try to wait for an
instruction boundary before proceeding. Since the CPU the thread context
is attached to may be inactive, it may not get around to reaching an
instruction boundary, and the event may not happen for an indefinite
period of time.

Instead, assume that inactive CPUs are already at instruction
boundaries, and trigger the event manually.

Change-Id: I9a67a49f9a52bdf9b1f0b88a1d173aa2bdfb5a16
---
M src/base/remote_gdb.cc
1 file changed, 10 insertions(+), 3 deletions(-)



diff --git a/src/base/remote_gdb.cc b/src/base/remote_gdb.cc
index 20b26b9..96b09be 100644
--- a/src/base/remote_gdb.cc
+++ b/src/base/remote_gdb.cc
@@ -784,9 +784,16 @@
 void
 BaseRemoteGDB::scheduleInstCommitEvent(Event *ev, int delta)
 {
-    // Here "ticks" aren't simulator ticks which measure time, they're
-    // instructions committed by the CPU.
-    tc->scheduleInstCountEvent(ev, tc->getCurrentInstCount() + delta);
+    if (delta == 0 && tc->status() != ThreadContext::Active) {
+        // If delta is zero, we're just trying to wait for an instruction
+        // boundary. If the CPU is not active, assume we're already at a
+        // boundary without waiting for the CPU to eventually wake up.
+        ev->process();
+    } else {
+        // Here "ticks" aren't simulator ticks which measure time, they're
+        // instructions committed by the CPU.
+        tc->scheduleInstCountEvent(ev, tc->getCurrentInstCount() + delta);
+    }
 }

 void

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44612
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I9a67a49f9a52bdf9b1f0b88a1d173aa2bdfb5a16
Gerrit-Change-Number: 44612
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to