summaryrefslogtreecommitdiff
path: root/src/base
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2006-12-20 18:39:40 -0500
committerGabe Black <gblack@eecs.umich.edu>2006-12-20 18:39:40 -0500
commitf13155393df010665b468db5e2e64131a7b2c5da (patch)
tree09a0ee16d3be4a53c2c275f7f403665bd644707b /src/base
parent841d76d37bb86b2ad05ce378282605a748c314eb (diff)
downloadgem5-f13155393df010665b468db5e2e64131a7b2c5da.tar.xz
Initial work to make remote gdb available in SE mode. This is completely untested.
--HG-- extra : convert_revision : 3ad9a3368961d5e9e71f702da84ffe293fe8adc8
Diffstat (limited to 'src/base')
-rw-r--r--src/base/remote_gdb.cc37
-rw-r--r--src/base/remote_gdb.hh5
2 files changed, 34 insertions, 8 deletions
diff --git a/src/base/remote_gdb.cc b/src/base/remote_gdb.cc
index 59a9b87d5..b1f50755b 100644
--- a/src/base/remote_gdb.cc
+++ b/src/base/remote_gdb.cc
@@ -121,16 +121,21 @@
#include <string>
#include <unistd.h>
+#include "config/full_system.hh"
+
+#if FULL_SYSTEM
#include "arch/vtophys.hh"
+#endif
+
#include "base/intmath.hh"
#include "base/remote_gdb.hh"
#include "base/socket.hh"
#include "base/trace.hh"
-#include "config/full_system.hh"
#include "cpu/thread_context.hh"
#include "cpu/static_inst.hh"
-#include "mem/physical.hh"
+//#include "mem/physical.hh"
#include "mem/port.hh"
+#include "mem/translating_port.hh"
#include "sim/system.hh"
using namespace std;
@@ -448,9 +453,17 @@ BaseRemoteGDB::read(Addr vaddr, size_t size, char *data)
DPRINTF(GDBRead, "read: addr=%#x, size=%d", vaddr, size);
- VirtualPort *vp = context->getVirtPort(context);
- vp->readBlob(vaddr, (uint8_t*)data, size);
- context->delVirtPort(vp);
+#if FULL_SYSTEM
+ VirtualPort *port = context->getVirtPort(context);
+#else
+ TranslatingPort *port = context->getMemPort();
+#endif
+ port->readBlob(vaddr, (uint8_t*)data, size);
+#if FULL_SYSTEM
+ context->delVirtPort(port);
+#else
+ delete port;
+#endif
#if TRACING_ON
if (DTRACE(GDBRead)) {
@@ -487,9 +500,17 @@ BaseRemoteGDB::write(Addr vaddr, size_t size, const char *data)
} else
DPRINTFNR("\n");
}
- VirtualPort *vp = context->getVirtPort(context);
- vp->writeBlob(vaddr, (uint8_t*)data, size);
- context->delVirtPort(vp);
+#if FULL_SYSTEM
+ VirtualPort *port = context->getVirtPort(context);
+#else
+ TranslatingPort *port = context->getMemPort();
+#endif
+ port->writeBlob(vaddr, (uint8_t*)data, size);
+#if FULL_SYSTEM
+ context->delVirtPort(port);
+#else
+ delete port;
+#endif
return true;
}
diff --git a/src/base/remote_gdb.hh b/src/base/remote_gdb.hh
index 9a3201c95..92e599585 100644
--- a/src/base/remote_gdb.hh
+++ b/src/base/remote_gdb.hh
@@ -32,6 +32,7 @@
#define __REMOTE_GDB_HH__
#include <map>
+#include <sys/signal.h>
#include "arch/types.hh"
#include "cpu/pc_event.hh"
@@ -177,6 +178,10 @@ class BaseRemoteGDB
virtual bool acc(Addr addr, size_t len) = 0;
bool trap(int type);
+ virtual bool breakpoint()
+ {
+ return trap(SIGTRAP);
+ }
protected:
virtual void getregs() = 0;