summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2007-02-22 20:05:32 -0500
committerAli Saidi <saidi@eecs.umich.edu>2007-02-22 20:05:32 -0500
commita5b73a6e332c3f27ce29346229e1f91c04f53cf9 (patch)
tree704eedc0f907ea64a954d0f870fb5314851876f9 /src
parentb750d6a597cea8fa1671a7397dd38c3c932a28c3 (diff)
parentc003dda793b5cc6fb9d9953fa1477849ddc42944 (diff)
downloadgem5-a5b73a6e332c3f27ce29346229e1f91c04f53cf9.tar.xz
Merge zizzer:/bk/newmem
into pb15.local:/Users/ali/work/m5.newmem --HG-- extra : convert_revision : 887b278dac6db5ea17ade641de84d0ab8b05db96
Diffstat (limited to 'src')
-rw-r--r--src/sim/system.cc36
1 files changed, 21 insertions, 15 deletions
diff --git a/src/sim/system.cc b/src/sim/system.cc
index f6febe4b1..1a87e1754 100644
--- a/src/sim/system.cc
+++ b/src/sim/system.cc
@@ -142,6 +142,7 @@ System::~System()
}
int rgdb_wait = -1;
+int rgdb_enable = true;
void
System::setMemoryMode(MemoryMode mode)
@@ -152,7 +153,9 @@ System::setMemoryMode(MemoryMode mode)
bool System::breakpoint()
{
- return remoteGDB[0]->breakpoint();
+ if (remoteGDB.size())
+ return remoteGDB[0]->breakpoint();
+ return false;
}
int
@@ -174,22 +177,24 @@ System::registerThreadContext(ThreadContext *tc, int id)
threadContexts[id] = tc;
numcpus++;
- RemoteGDB *rgdb = new RemoteGDB(this, tc);
- GDBListener *gdbl = new GDBListener(rgdb, 7000 + 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();
+ if (rgdb_enable) {
+ RemoteGDB *rgdb = new RemoteGDB(this, tc);
+ GDBListener *gdbl = new GDBListener(rgdb, 7000 + 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();
+
+ if (remoteGDB.size() <= id) {
+ remoteGDB.resize(id + 1);
+ }
- if (remoteGDB.size() <= id) {
- remoteGDB.resize(id + 1);
+ remoteGDB[id] = rgdb;
}
- remoteGDB[id] = rgdb;
-
return id;
}
@@ -210,7 +215,8 @@ System::replaceThreadContext(ThreadContext *tc, int id)
}
threadContexts[id] = tc;
- remoteGDB[id]->replaceThreadContext(tc);
+ if (id < remoteGDB.size())
+ remoteGDB[id]->replaceThreadContext(tc);
}
#if !FULL_SYSTEM