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 <gabe.black@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
This commit is contained in:
@@ -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 @@ BaseRemoteGDB::detach()
|
||||
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
|
||||
|
||||
@@ -163,7 +163,7 @@ class BaseRemoteGDB
|
||||
void detach();
|
||||
bool isAttached() { return attached; }
|
||||
|
||||
void replaceThreadContext(ThreadContext *_tc) { tc = _tc; }
|
||||
void replaceThreadContext(ThreadContext *_tc);
|
||||
|
||||
bool trap(int type);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user