Initial work to make remote gdb available in SE mode. This is completely untested.

--HG--
extra : convert_revision : 3ad9a3368961d5e9e71f702da84ffe293fe8adc8
This commit is contained in:
Gabe Black 2006-12-20 18:39:40 -05:00
parent 841d76d37b
commit f13155393d
12 changed files with 48 additions and 45 deletions

View file

@ -62,6 +62,7 @@ base_sources = Split('''
base/pollevent.cc
base/range.cc
base/random.cc
base/remote_gdb.cc
base/sat_counter.cc
base/socket.cc
base/statistics.cc
@ -171,7 +172,6 @@ mysql_sources = Split('''
full_system_sources = Split('''
base/crc.cc
base/inet.cc
base/remote_gdb.cc
cpu/intr_control.cc
cpu/profile.cc

View file

@ -52,6 +52,7 @@ base_sources = Split('''
intregfile.cc
miscregfile.cc
regfile.cc
remote_gdb.cc
''')
# Full-system sources
@ -66,7 +67,6 @@ full_system_sources = Split('''
osfpal.cc
pagetable.cc
stacktrace.cc
remote_gdb.cc
system.cc
tlb.cc
tru64/system.cc

View file

@ -195,12 +195,6 @@ AlphaSystem::setAlphaAccess(Addr access)
panic("could not find m5AlphaAccess\n");
}
bool
AlphaSystem::breakpoint()
{
return remoteGDB[0]->trap(SIGTRAP);
}
void
AlphaSystem::serialize(std::ostream &os)
{

View file

@ -56,8 +56,6 @@ class AlphaSystem : public System
~AlphaSystem();
virtual bool breakpoint();
/**
* Serialization stuff
*/

View file

@ -50,12 +50,12 @@ base_sources = Split('''
intregfile.cc
miscregfile.cc
regfile.cc
remote_gdb.cc
''')
# Full-system sources
full_system_sources = Split('''
arguments.cc
remote_gdb.cc
pagetable.cc
stacktrace.cc
system.cc

View file

@ -191,12 +191,6 @@ SparcSystem::~SparcSystem()
delete partition_desc;
}
bool
SparcSystem::breakpoint()
{
panic("Need to implement");
}
void
SparcSystem::serialize(std::ostream &os)
{

View file

@ -68,8 +68,6 @@ class SparcSystem : public System
~SparcSystem();
virtual bool breakpoint();
/**
* Serialization stuff
*/

View file

@ -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;
}

View file

@ -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;

View file

@ -54,15 +54,15 @@ namespace TheISA
}
class MemObject;
class RemoteGDB;
class GDBListener;
#else
class Process;
#endif // FULL_SYSTEM
class RemoteGDB;
class GDBListener;
class ThreadContext;
class Checkpoint;

View file

@ -32,6 +32,7 @@
*/
#include "arch/isa_traits.hh"
#include "arch/remote_gdb.hh"
#include "base/loader/object_file.hh"
#include "base/loader/symtab.hh"
#include "base/trace.hh"
@ -43,7 +44,6 @@
#include "sim/system.hh"
#if FULL_SYSTEM
#include "arch/vtophys.hh"
#include "arch/remote_gdb.hh"
#include "kern/kernel_stats.hh"
#endif
@ -141,14 +141,8 @@ System::~System()
#endif // FULL_SYSTEM}
}
#if FULL_SYSTEM
int rgdb_wait = -1;
#endif // FULL_SYSTEM
void
System::setMemoryMode(MemoryMode mode)
{
@ -156,6 +150,11 @@ System::setMemoryMode(MemoryMode mode)
memoryMode = mode;
}
bool System::breakpoint()
{
return remoteGDB[0]->breakpoint();
}
int
System::registerThreadContext(ThreadContext *tc, int id)
{
@ -175,7 +174,6 @@ System::registerThreadContext(ThreadContext *tc, int id)
threadContexts[id] = tc;
numcpus++;
#if FULL_SYSTEM
RemoteGDB *rgdb = new RemoteGDB(this, tc);
GDBListener *gdbl = new GDBListener(rgdb, 7000 + id);
gdbl->listen();
@ -191,7 +189,6 @@ System::registerThreadContext(ThreadContext *tc, int id)
}
remoteGDB[id] = rgdb;
#endif // FULL_SYSTEM
return id;
}
@ -213,9 +210,7 @@ System::replaceThreadContext(ThreadContext *tc, int id)
}
threadContexts[id] = tc;
#if FULL_SYSTEM
remoteGDB[id]->replaceThreadContext(tc);
#endif // FULL_SYSTEM
}
#if !FULL_SYSTEM

View file

@ -55,12 +55,12 @@ class PhysicalMemory;
#if FULL_SYSTEM
class Platform;
#endif
class GDBListener;
namespace TheISA
{
class RemoteGDB;
}
#endif
class System : public SimObject
{
@ -159,11 +159,9 @@ class System : public SimObject
#endif
public:
#if FULL_SYSTEM
std::vector<TheISA::RemoteGDB *> remoteGDB;
std::vector<GDBListener *> gdbListen;
virtual bool breakpoint() = 0;
#endif // FULL_SYSTEM
bool breakpoint();
public:
struct Params