From 45c3f1747c78aff3495edfe2cbe35fbb7a67f2a4 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 22 Jan 2007 22:22:09 -0800 Subject: [PATCH] Added remote gdb objects to each process --HG-- extra : convert_revision : 1b5c1470ffc52b2f7719e469153702dec694f9a3 --- src/sim/process.cc | 8 ++++++++ src/sim/process.hh | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/sim/process.cc b/src/sim/process.cc index b43fa7d00..1a0f54842 100644 --- a/src/sim/process.cc +++ b/src/sim/process.cc @@ -35,6 +35,7 @@ #include +#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; } diff --git a/src/sim/process.hh b/src/sim/process.hh index 616c02c00..bf65c6e06 100644 --- a/src/sim/process.hh +++ b/src/sim/process.hh @@ -51,6 +51,11 @@ class SyscallDesc; class PageTable; class TranslatingPort; class System; +class GDBListener; +namespace TheISA +{ + class RemoteGDB; +} void copyStringArray(std::vector &strings, Addr array_ptr, @@ -72,6 +77,11 @@ class Process : public SimObject // thread contexts associated with this process std::vector threadContexts; + // 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 threadContexts.size(); } -- 2.30.2