Merge zizzer:/bk/newmem

into  pb15.local:/Users/ali/work/m5.newmem

--HG--
extra : convert_revision : 887b278dac6db5ea17ade641de84d0ab8b05db96
This commit is contained in:
Ali Saidi 2007-02-22 20:05:32 -05:00
commit a5b73a6e33

View file

@ -142,6 +142,7 @@ System::~System()
} }
int rgdb_wait = -1; int rgdb_wait = -1;
int rgdb_enable = true;
void void
System::setMemoryMode(MemoryMode mode) System::setMemoryMode(MemoryMode mode)
@ -152,7 +153,9 @@ System::setMemoryMode(MemoryMode mode)
bool System::breakpoint() bool System::breakpoint()
{ {
return remoteGDB[0]->breakpoint(); if (remoteGDB.size())
return remoteGDB[0]->breakpoint();
return false;
} }
int int
@ -174,22 +177,24 @@ System::registerThreadContext(ThreadContext *tc, int id)
threadContexts[id] = tc; threadContexts[id] = tc;
numcpus++; numcpus++;
RemoteGDB *rgdb = new RemoteGDB(this, tc); if (rgdb_enable) {
GDBListener *gdbl = new GDBListener(rgdb, 7000 + id); RemoteGDB *rgdb = new RemoteGDB(this, tc);
gdbl->listen(); GDBListener *gdbl = new GDBListener(rgdb, 7000 + id);
/** gdbl->listen();
* Uncommenting this line waits for a remote debugger to connect /**
* to the simulator before continuing. * 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_wait != -1 && rgdb_wait == id)
gdbl->accept();
if (remoteGDB.size() <= id) { if (remoteGDB.size() <= id) {
remoteGDB.resize(id + 1); remoteGDB.resize(id + 1);
}
remoteGDB[id] = rgdb;
} }
remoteGDB[id] = rgdb;
return id; return id;
} }
@ -210,7 +215,8 @@ System::replaceThreadContext(ThreadContext *tc, int id)
} }
threadContexts[id] = tc; threadContexts[id] = tc;
remoteGDB[id]->replaceThreadContext(tc); if (id < remoteGDB.size())
remoteGDB[id]->replaceThreadContext(tc);
} }
#if !FULL_SYSTEM #if !FULL_SYSTEM