diff --git a/src/cpu/checker/cpu.hh b/src/cpu/checker/cpu.hh index 450ce62288..73b27161a5 100644 --- a/src/cpu/checker/cpu.hh +++ b/src/cpu/checker/cpu.hh @@ -54,9 +54,6 @@ namespace TheISA class Processor; class PhysicalMemory; -class RemoteGDB; -class GDBListener; - #else class Process; diff --git a/src/cpu/ozone/cpu.hh b/src/cpu/ozone/cpu.hh index a16986c997..fba5886f85 100644 --- a/src/cpu/ozone/cpu.hh +++ b/src/cpu/ozone/cpu.hh @@ -58,9 +58,6 @@ namespace TheISA class PhysicalMemory; class MemoryController; -class RemoteGDB; -class GDBListener; - namespace TheISA { namespace Kernel { class Statistics; diff --git a/src/cpu/simple/base.cc b/src/cpu/simple/base.cc index 713ffd0818..7f40138d2b 100644 --- a/src/cpu/simple/base.cc +++ b/src/cpu/simple/base.cc @@ -76,7 +76,6 @@ #include "arch/stacktrace.hh" #include "arch/tlb.hh" #include "arch/vtophys.hh" -#include "base/remote_gdb.hh" #else // !FULL_SYSTEM #include "mem/mem_object.hh" #endif // FULL_SYSTEM diff --git a/src/cpu/simple/base.hh b/src/cpu/simple/base.hh index 87e2115212..1265a1f2f2 100644 --- a/src/cpu/simple/base.hh +++ b/src/cpu/simple/base.hh @@ -63,9 +63,6 @@ class Process; #endif // FULL_SYSTEM -class RemoteGDB; -class GDBListener; - namespace TheISA { class Predecoder; diff --git a/src/python/m5/main.py b/src/python/m5/main.py index 29f8cc9764..fd58ce5005 100644 --- a/src/python/m5/main.py +++ b/src/python/m5/main.py @@ -101,7 +101,7 @@ set_group("Debugging Options") add_option("--debug-break", metavar="TIME[,TIME]", action='append', split=',', help="Cycle to create a breakpoint") add_option("--remote-gdb-port", type='int', default=7000, - help="Remote gdb base port") + help="Remote gdb base port (set to 0 to disable listening)") # Tracing options set_group("Trace Options") diff --git a/src/sim/process.hh b/src/sim/process.hh index ab9d64cf33..36db8d0913 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 contextIds; - // remote gdb objects - std::vector remoteGDB; - std::vector 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 da77f19958..c7f5b2d08f 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();