summaryrefslogtreecommitdiff
path: root/src/sim
diff options
context:
space:
mode:
authorSteve Reinhardt <steve.reinhardt@amd.com>2010-06-03 16:54:26 -0700
committerSteve Reinhardt <steve.reinhardt@amd.com>2010-06-03 16:54:26 -0700
commitf92e91e85309e9dcfd0b3c5a8e4faa460d921b7f (patch)
treeb0b0362e50679e753bbd7db4aafce8376d8571e2 /src/sim
parent4a3ce94386da669e82e1fd32fb201e2c9385938e (diff)
downloadgem5-f92e91e85309e9dcfd0b3c5a8e4faa460d921b7f.tar.xz
Minor remote GDB cleanup.
Expand the help text on the --remote-gdb-port option so people know you can use it to disable remote gdb without reading the source code, and thus don't waste any time trying to add a separate option to do that. Clean up some gdb-related cruft I found while looking for where one would add a gdb disable option, before I found the comment that told me that I didn't need to do that.
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/process.hh5
-rw-r--r--src/sim/system.cc17
2 files changed, 9 insertions, 13 deletions
diff --git a/src/sim/process.hh b/src/sim/process.hh
index ab9d64cf3..36db8d091 100644
--- a/src/sim/process.hh
+++ b/src/sim/process.hh
@@ -91,11 +91,6 @@ class Process : public SimObject
// thread contexts associated with this process
std::vector<int> contextIds;
- // remote gdb objects
- std::vector<BaseRemoteGDB *> remoteGDB;
- std::vector<GDBListener *> gdbListen;
- bool breakpoint();
-
// number of CPUs (esxec contexts, really) assigned to this process.
unsigned int numCpus() { return contextIds.size(); }
diff --git a/src/sim/system.cc b/src/sim/system.cc
index da77f1995..c7f5b2d08 100644
--- a/src/sim/system.cc
+++ b/src/sim/system.cc
@@ -151,9 +151,6 @@ System::~System()
#endif // FULL_SYSTEM}
}
-int rgdb_wait = -1;
-int rgdb_enable = true;
-
void
System::setMemoryMode(Enums::MemoryMode mode)
{
@@ -168,6 +165,13 @@ bool System::breakpoint()
return false;
}
+/**
+ * Setting rgdb_wait to a positive integer waits for a remote debugger to
+ * connect to that context ID before continuing. This should really
+ be a parameter on the CPU object or something...
+ */
+int rgdb_wait = -1;
+
int
System::registerThreadContext(ThreadContext *tc, int assigned)
{
@@ -193,14 +197,11 @@ System::registerThreadContext(ThreadContext *tc, int assigned)
_numContexts++;
int port = getRemoteGDBPort();
- if (rgdb_enable && port) {
+ if (port) {
RemoteGDB *rgdb = new RemoteGDB(this, tc);
GDBListener *gdbl = new GDBListener(rgdb, port + id);
gdbl->listen();
- /**
- * Uncommenting this line waits for a remote debugger to
- * connect to the simulator before continuing.
- */
+
if (rgdb_wait != -1 && rgdb_wait == id)
gdbl->accept();