summaryrefslogtreecommitdiff
path: root/src/sim/system.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/sim/system.cc')
-rw-r--r--src/sim/system.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sim/system.cc b/src/sim/system.cc
index 10b9b1217..803881539 100644
--- a/src/sim/system.cc
+++ b/src/sim/system.cc
@@ -42,6 +42,7 @@
#include "mem/physical.hh"
#include "sim/byteswap.hh"
#include "sim/system.hh"
+#include "sim/debug.hh"
#if FULL_SYSTEM
#include "arch/vtophys.hh"
#include "kern/kernel_stats.hh"
@@ -183,9 +184,10 @@ System::registerThreadContext(ThreadContext *tc, int id)
threadContexts[id] = tc;
numcpus++;
- if (rgdb_enable) {
+ int port = getRemoteGDBPort();
+ if (rgdb_enable && port) {
RemoteGDB *rgdb = new RemoteGDB(this, tc);
- GDBListener *gdbl = new GDBListener(rgdb, 7000 + id);
+ GDBListener *gdbl = new GDBListener(rgdb, port + id);
gdbl->listen();
/**
* Uncommenting this line waits for a remote debugger to