Gabe Black has submitted this change. (
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
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44612
Reviewed-by: Gabe Black <gabe.bl...@gmail.com>
Maintainer: Gabe Black <gabe.bl...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/base/remote_gdb.cc
1 file changed, 10 insertions(+), 3 deletions(-)
Approvals:
Gabe Black: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/base/remote_gdb.cc b/src/base/remote_gdb.cc
index 4c54e64..589e144 100644
--- a/src/base/remote_gdb.cc
+++ b/src/base/remote_gdb.cc
@@ -790,9 +790,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: 8
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Bobby R. Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Daniel Carvalho <oda...@yahoo.com.br>
Gerrit-Reviewer: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-CC: Boris Shingarov <shinga...@gmail.com>
Gerrit-MessageType: merged
_______________________________________________
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