Make it easier to turn off the remote debugger
--HG-- extra : convert_revision : d88784736df5f9b498770fb7e98f52715669c0e1
This commit is contained in:
parent
fa4c3d74fe
commit
c003dda793
1 changed files with 21 additions and 15 deletions
|
@ -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()
|
||||
{
|
||||
if (remoteGDB.size())
|
||||
return remoteGDB[0]->breakpoint();
|
||||
return false;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -174,12 +177,13 @@ System::registerThreadContext(ThreadContext *tc, int id)
|
|||
threadContexts[id] = tc;
|
||||
numcpus++;
|
||||
|
||||
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.
|
||||
* Uncommenting this line waits for a remote debugger to
|
||||
* connect to the simulator before continuing.
|
||||
*/
|
||||
if (rgdb_wait != -1 && rgdb_wait == id)
|
||||
gdbl->accept();
|
||||
|
@ -189,6 +193,7 @@ System::registerThreadContext(ThreadContext *tc, int id)
|
|||
}
|
||||
|
||||
remoteGDB[id] = rgdb;
|
||||
}
|
||||
|
||||
return id;
|
||||
}
|
||||
|
@ -210,6 +215,7 @@ System::replaceThreadContext(ThreadContext *tc, int id)
|
|||
}
|
||||
|
||||
threadContexts[id] = tc;
|
||||
if (id < remoteGDB.size())
|
||||
remoteGDB[id]->replaceThreadContext(tc);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue