Gabe Black has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/44610 )
Change subject: base: Check the context ID when replacing a ThreadContext
in GDB.
......................................................................
base: Check the context ID when replacing a ThreadContext in GDB.
This says *which* thread context you're replacing. Right now it's
implied that you're replacing the only thread context, but once we
support having multiple threads in the same GDB endpoint, that will no
longer be implied.
Change-Id: I5a789d12bbe195e019d5ccd8a005b5a6f16b9299
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44610
Maintainer: Gabe Black <[email protected]>
Tested-by: kokoro <[email protected]>
Reviewed-by: Daniel Carvalho <[email protected]>
---
M src/base/remote_gdb.cc
M src/base/remote_gdb.hh
2 files changed, 10 insertions(+), 1 deletion(-)
Approvals:
Daniel Carvalho: Looks good to me, approved
Gabe Black: Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/base/remote_gdb.cc b/src/base/remote_gdb.cc
index 16373e6..efda8e8 100644
--- a/src/base/remote_gdb.cc
+++ b/src/base/remote_gdb.cc
@@ -141,6 +141,7 @@
#include "base/cprintf.hh"
#include "base/intmath.hh"
+#include "base/logging.hh"
#include "base/socket.hh"
#include "base/trace.hh"
#include "cpu/base.hh"
@@ -436,6 +437,14 @@
DPRINTFN("remote gdb detached\n");
}
+void
+BaseRemoteGDB::replaceThreadContext(ThreadContext *_tc)
+{
+ ContextID id = _tc->contextId();
+ panic_if(id != tc->contextId(), "No context with ID %d found.", id);
+ tc = _tc;
+}
+
// This function does all command processing for interfacing to a
// remote gdb. Note that the error codes are ignored by gdb at
// present, but might eventually become meaningful. (XXX) It might
diff --git a/src/base/remote_gdb.hh b/src/base/remote_gdb.hh
index 211bf2e..ba274e6 100644
--- a/src/base/remote_gdb.hh
+++ b/src/base/remote_gdb.hh
@@ -163,7 +163,7 @@
void detach();
bool isAttached() { return attached; }
- void replaceThreadContext(ThreadContext *_tc) { tc = _tc; }
+ void replaceThreadContext(ThreadContext *_tc);
bool trap(int type);
3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the
submitted one.
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44610
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: I5a789d12bbe195e019d5ccd8a005b5a6f16b9299
Gerrit-Change-Number: 44610
Gerrit-PatchSet: 5
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Bobby R. Bruce <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s