Added remote gdb objects to each process
authorGabe Black <gblack@eecs.umich.edu>
Tue, 23 Jan 2007 06:22:09 +0000 (22:22 -0800)
committerGabe Black <gblack@eecs.umich.edu>
Tue, 23 Jan 2007 06:22:09 +0000 (22:22 -0800)
--HG--
extra : convert_revision : 1b5c1470ffc52b2f7719e469153702dec694f9a3

src/sim/process.cc
src/sim/process.hh

index b43fa7d00fc44b7a230d1eaba7cf9be48b5d3352..1a0f54842f797966b6a68d2803e20f3c55bbd6c4 100644 (file)
@@ -35,6 +35,7 @@
 
 #include <string>
 
+#include "arch/remote_gdb.hh"
 #include "base/intmath.hh"
 #include "base/loader/object_file.hh"
 #include "base/loader/symtab.hh"
@@ -154,6 +155,13 @@ Process::registerThreadContext(ThreadContext *tc)
     int myIndex = threadContexts.size();
     threadContexts.push_back(tc);
 
+    RemoteGDB *rgdb = new RemoteGDB(system, tc);
+    GDBListener *gdbl = new GDBListener(rgdb, 7000 + myIndex);
+    gdbl->listen();
+    //gdbl->accept();
+
+    remoteGDB.push_back(rgdb);
+
     // return CPU number to caller
     return myIndex;
 }
index 616c02c00920d70fc5c1f6fa658e6d403142231d..bf65c6e063b9a2cd20e2017f55a4e5c92bbab2ce 100644 (file)
@@ -51,6 +51,11 @@ class SyscallDesc;
 class PageTable;
 class TranslatingPort;
 class System;
+class GDBListener;
+namespace TheISA
+{
+    class RemoteGDB;
+}
 
 void
 copyStringArray(std::vector<std::string> &strings, Addr array_ptr,
@@ -72,6 +77,11 @@ class Process : public SimObject
     // thread contexts associated with this process
     std::vector<ThreadContext *> threadContexts;
 
+    // remote gdb objects
+    std::vector<TheISA::RemoteGDB *> remoteGDB;
+    std::vector<GDBListener *> gdbListen;
+    bool breakpoint();
+
     // number of CPUs (esxec contexts, really) assigned to this process.
     unsigned int numCpus() { return threadContexts.size(); }