Gabe Black has uploaded this change for review. ( 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
---
M src/base/remote_gdb.cc
M src/base/remote_gdb.hh
2 files changed, 9 insertions(+), 1 deletion(-)



diff --git a/src/base/remote_gdb.cc b/src/base/remote_gdb.cc
index d074c96..6f5841b 100644
--- a/src/base/remote_gdb.cc
+++ b/src/base/remote_gdb.cc
@@ -436,6 +436,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);


--
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: 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