gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
BaseRemoteGDB Class Referenceabstract

#include <remote_gdb.hh>

Inheritance diagram for BaseRemoteGDB:
AlphaISA::RemoteGDB ArmISA::RemoteGDB MipsISA::RemoteGDB PowerISA::RemoteGDB RiscvISA::RemoteGDB SparcISA::RemoteGDB X86ISA::RemoteGDB

Classes

struct  BadClient
 Exception to throw when the connection to the client is broken. More...
 
class  BaseGdbRegCache
 Concrete subclasses of this abstract class represent how the register values are transmitted on the wire. More...
 
struct  CmdError
 Exception to throw when an error needs to be reported to the client. More...
 
class  HardBreakpoint
 
class  InputEvent
 
class  SingleStepEvent
 
class  TrapEvent
 
class  Unsupported
 Exception to throw when something isn't supported. More...
 

Public Member Functions

bool breakpoint ()
 
void replaceThreadContext (ThreadContext *tc)
 
virtual ~BaseRemoteGDB ()
 
 BaseRemoteGDB (System *system, ThreadContext *context)
 
virtual ~BaseRemoteGDB ()
 
virtual BaseGdbRegCachegdbRegs ()=0
 
void replaceThreadContext (ThreadContext *tc)
 
void attach (int fd)
 
void detach ()
 
bool isattached ()
 
virtual bool acc (Addr addr, size_t len)=0
 
bool trap (int type)
 
virtual bool breakpoint ()
 
std::string name ()
 

Protected Types

typedef std::map< Addr,
HardBreakpoint * > 
break_map_t
 
typedef break_map_t::iterator break_iter_t
 

Protected Member Functions

int digit2i (char)
 
char i2digit (int)
 
Addr hex2i (const char **)
 
virtual void mem2hex (char *, const char *, int)
 
virtual const char * hex2mem (char *, const char *, int)
 
virtual const char * break_type (char c)
 
bool cmd_unsupported (GdbCommand::Context &ctx)
 
bool cmd_signal (GdbCommand::Context &ctx)
 
bool cmd_cont (GdbCommand::Context &ctx)
 
bool cmd_async_cont (GdbCommand::Context &ctx)
 
bool cmd_detach (GdbCommand::Context &ctx)
 
bool cmd_reg_r (GdbCommand::Context &ctx)
 
bool cmd_reg_w (GdbCommand::Context &ctx)
 
bool cmd_set_thread (GdbCommand::Context &ctx)
 
bool cmd_mem_r (GdbCommand::Context &ctx)
 
bool cmd_mem_w (GdbCommand::Context &ctx)
 
bool cmd_query_var (GdbCommand::Context &ctx)
 
bool cmd_step (GdbCommand::Context &ctx)
 
bool cmd_async_step (GdbCommand::Context &ctx)
 
bool cmd_clr_hw_bkpt (GdbCommand::Context &ctx)
 
bool cmd_set_hw_bkpt (GdbCommand::Context &ctx)
 
uint8_t getbyte ()
 
void putbyte (uint8_t b)
 
int recv (char *data, int len)
 
void send (const char *data)
 
virtual bool read (Addr addr, size_t size, char *data)
 
virtual bool write (Addr addr, size_t size, const char *data)
 
template<class T >
read (Addr addr)
 
template<class T >
void write (Addr addr, T data)
 
void clearSingleStep ()
 
void setSingleStep ()
 
PCEventQueuegetPcEventQueue ()
 
EventQueuegetComInstEventQueue ()
 
void scheduleInstCommitEvent (Event *ev, int delta)
 Schedule an event which will be triggered "delta" instructions later. More...
 
void descheduleInstCommitEvent (Event *ev)
 Deschedule an instruction count based event. More...
 
virtual bool checkBpLen (size_t len)
 
void insertSoftBreak (Addr addr, size_t len)
 
void removeSoftBreak (Addr addr, size_t len)
 
virtual void insertHardBreak (Addr addr, size_t len)
 
void removeHardBreak (Addr addr, size_t len)
 
void clearTempBreakpoint (Addr &bkpt)
 
void setTempBreakpoint (Addr bkpt)
 

Protected Attributes

InputEventinputEvent
 
TrapEvent trapEvent
 
GDBListenerlistener
 
int number
 
int fd
 
bool active
 
bool attached
 
Systemsystem
 
ThreadContextcontext
 
BaseGdbRegCacheregCachePtr
 
SingleStepEvent singleStepEvent
 
break_map_t hardBreakMap
 

Static Protected Attributes

static std::map< char, GdbCommandcommand_map
 

Friends

class GDBListener
 
class InputEvent
 
class HardBreakpoint
 
void debugger ()
 

Detailed Description

Definition at line 45 of file remote_gdb.hh.

Member Typedef Documentation

typedef break_map_t::iterator BaseRemoteGDB::break_iter_t
protected

Definition at line 309 of file remote_gdb.hh.

typedef std::map<Addr, HardBreakpoint *> BaseRemoteGDB::break_map_t
protected

Definition at line 308 of file remote_gdb.hh.

Constructor & Destructor Documentation

BaseRemoteGDB::~BaseRemoteGDB ( )
inlinevirtual

Definition at line 53 of file remote_gdb.hh.

BaseRemoteGDB::BaseRemoteGDB ( System system,
ThreadContext context 
)

Definition at line 289 of file remote_gdb.cc.

virtual BaseRemoteGDB::~BaseRemoteGDB ( )
virtual

Member Function Documentation

virtual bool BaseRemoteGDB::acc ( Addr  addr,
size_t  len 
)
pure virtual
void BaseRemoteGDB::attach ( int  fd)

Definition at line 313 of file remote_gdb.cc.

References attached, DPRINTFN, ArmISA::f, fd, InputEvent, inputEvent, pollQueue, and PollQueue::schedule().

Referenced by GDBListener::accept().

const char * BaseRemoteGDB::break_type ( char  c)
protectedvirtual

Definition at line 659 of file remote_gdb.cc.

References GdbAccWp, GdbHardBp, GdbReadWp, GdbSoftBp, and GdbWriteWp.

Referenced by cmd_clr_hw_bkpt(), and cmd_set_hw_bkpt().

bool BaseRemoteGDB::breakpoint ( )
inline

Definition at line 50 of file remote_gdb.hh.

virtual bool BaseRemoteGDB::breakpoint ( )
inlinevirtual

Definition at line 258 of file remote_gdb.hh.

References trap().

bool BaseRemoteGDB::checkBpLen ( size_t  len)
protectedvirtual

Reimplemented in X86ISA::RemoteGDB.

Definition at line 562 of file remote_gdb.cc.

Referenced by insertHardBreak(), insertSoftBreak(), removeHardBreak(), and removeSoftBreak().

void BaseRemoteGDB::clearSingleStep ( )
protected

Definition at line 521 of file remote_gdb.cc.

References descheduleInstCommitEvent(), and singleStepEvent.

Referenced by cmd_async_cont(), cmd_cont(), detach(), and trap().

void BaseRemoteGDB::clearTempBreakpoint ( Addr bkpt)
protected

Definition at line 643 of file remote_gdb.cc.

References DPRINTF, and removeHardBreak().

bool BaseRemoteGDB::cmd_async_cont ( GdbCommand::Context ctx)
protected
bool BaseRemoteGDB::cmd_async_step ( GdbCommand::Context ctx)
protected
bool BaseRemoteGDB::cmd_clr_hw_bkpt ( GdbCommand::Context ctx)
protected
bool BaseRemoteGDB::cmd_cont ( GdbCommand::Context ctx)
protected
bool BaseRemoteGDB::cmd_detach ( GdbCommand::Context ctx)
protected

Definition at line 771 of file remote_gdb.cc.

References detach().

bool BaseRemoteGDB::cmd_mem_r ( GdbCommand::Context ctx)
protected
bool BaseRemoteGDB::cmd_mem_w ( GdbCommand::Context ctx)
protected
bool BaseRemoteGDB::cmd_query_var ( GdbCommand::Context ctx)
protected

Definition at line 860 of file remote_gdb.cc.

References GdbCommand::Context::data, GdbCommand::Context::len, and send().

bool BaseRemoteGDB::cmd_reg_r ( GdbCommand::Context ctx)
protected
bool BaseRemoteGDB::cmd_reg_w ( GdbCommand::Context ctx)
protected
bool BaseRemoteGDB::cmd_set_hw_bkpt ( GdbCommand::Context ctx)
protected
bool BaseRemoteGDB::cmd_set_thread ( GdbCommand::Context ctx)
protected

Definition at line 802 of file remote_gdb.cc.

References GdbCommand::Context::data, hex2i(), MipsISA::p, and send().

bool BaseRemoteGDB::cmd_signal ( GdbCommand::Context ctx)
protected

Definition at line 739 of file remote_gdb.cc.

References csprintf(), send(), and GdbCommand::Context::type.

bool BaseRemoteGDB::cmd_step ( GdbCommand::Context ctx)
protected
bool BaseRemoteGDB::cmd_unsupported ( GdbCommand::Context ctx)
protected
void BaseRemoteGDB::descheduleInstCommitEvent ( Event ev)
protected

Deschedule an instruction count based event.

Definition at line 555 of file remote_gdb.cc.

References EventQueue::deschedule(), getComInstEventQueue(), and Event::scheduled().

Referenced by clearSingleStep().

void BaseRemoteGDB::detach ( )

Definition at line 325 of file remote_gdb.cc.

References active, attached, clearSingleStep(), DPRINTFN, fd, inputEvent, pollQueue, and PollQueue::remove().

Referenced by cmd_detach(), and trap().

int BaseRemoteGDB::digit2i ( char  c)
protected

Definition at line 1043 of file remote_gdb.cc.

Referenced by hex2i(), hex2mem(), and recv().

virtual BaseGdbRegCache* BaseRemoteGDB::gdbRegs ( )
pure virtual
uint8_t BaseRemoteGDB::getbyte ( )
protected

Definition at line 342 of file remote_gdb.cc.

References ArmISA::b, fd, and read().

Referenced by recv(), and send().

EventQueue * BaseRemoteGDB::getComInstEventQueue ( )
protected
PCEventQueue * BaseRemoteGDB::getPcEventQueue ( )
protected

Definition at line 533 of file remote_gdb.cc.

References system.

Addr BaseRemoteGDB::hex2i ( const char **  srcp)
protected
const char * BaseRemoteGDB::hex2mem ( char *  vdst,
const char *  src,
int  maxlen 
)
protectedvirtual

Definition at line 1081 of file remote_gdb.cc.

References digit2i().

Referenced by cmd_mem_w(), and cmd_reg_w().

char BaseRemoteGDB::i2digit ( int  n)
protected

Definition at line 1057 of file remote_gdb.cc.

Referenced by mem2hex(), and send().

void BaseRemoteGDB::insertHardBreak ( Addr  addr,
size_t  len 
)
protectedvirtual
void BaseRemoteGDB::insertSoftBreak ( Addr  addr,
size_t  len 
)
protected

Definition at line 584 of file remote_gdb.cc.

References checkBpLen(), and insertHardBreak().

Referenced by cmd_set_hw_bkpt().

bool BaseRemoteGDB::isattached ( )

Definition at line 309 of file remote_gdb.cc.

References attached.

Referenced by GDBListener::accept(), and debugger().

void BaseRemoteGDB::mem2hex ( char *  vdst,
const char *  vsrc,
int  len 
)
protectedvirtual

Definition at line 1064 of file remote_gdb.cc.

References i2digit().

Referenced by cmd_mem_r(), cmd_reg_r(), read(), and write().

string BaseRemoteGDB::name ( )
void BaseRemoteGDB::putbyte ( uint8_t  b)
protected

Definition at line 352 of file remote_gdb.cc.

References fd, and write().

Referenced by recv(), and send().

bool BaseRemoteGDB::read ( Addr  addr,
size_t  size,
char *  data 
)
protectedvirtual
template<class T >
T BaseRemoteGDB::read ( Addr  addr)
inlineprotected

Definition at line 327 of file remote_gdb.hh.

References read().

int BaseRemoteGDB::recv ( char *  data,
int  len 
)
protected

Definition at line 391 of file remote_gdb.cc.

References ArmISA::c, digit2i(), DPRINTF, GDBBadP, GDBEnd, GDBGoodP, GDBStart, getbyte(), ArmISA::len, MipsISA::p, and putbyte().

Referenced by trap().

void BaseRemoteGDB::removeHardBreak ( Addr  addr,
size_t  len 
)
protected
void BaseRemoteGDB::removeSoftBreak ( Addr  addr,
size_t  len 
)
protected

Definition at line 593 of file remote_gdb.cc.

References checkBpLen(), and removeHardBreak().

Referenced by cmd_clr_hw_bkpt().

void BaseRemoteGDB::replaceThreadContext ( ThreadContext tc)
inline

Definition at line 51 of file remote_gdb.hh.

void BaseRemoteGDB::replaceThreadContext ( ThreadContext tc)
inline

Definition at line 250 of file remote_gdb.hh.

References context.

void BaseRemoteGDB::scheduleInstCommitEvent ( Event ev,
int  delta 
)
protected

Schedule an event which will be triggered "delta" instructions later.

Definition at line 546 of file remote_gdb.cc.

References PowerISA::eq, getComInstEventQueue(), EventQueue::getCurTick(), and EventQueue::schedule().

Referenced by setSingleStep().

void BaseRemoteGDB::send ( const char *  data)
protected
void BaseRemoteGDB::setSingleStep ( )
protected

Definition at line 527 of file remote_gdb.cc.

References Event::scheduled(), scheduleInstCommitEvent(), and singleStepEvent.

Referenced by cmd_async_step(), and cmd_step().

void BaseRemoteGDB::setTempBreakpoint ( Addr  bkpt)
protected

Definition at line 636 of file remote_gdb.cc.

References DPRINTF, and insertHardBreak().

bool BaseRemoteGDB::trap ( int  type)
bool BaseRemoteGDB::write ( Addr  addr,
size_t  size,
const char *  data 
)
protectedvirtual
template<class T >
void BaseRemoteGDB::write ( Addr  addr,
data 
)
inlineprotected

Definition at line 336 of file remote_gdb.hh.

References write().

Friends And Related Function Documentation

void debugger ( )
friend

Definition at line 161 of file remote_gdb.cc.

friend class GDBListener
friend

Definition at line 81 of file remote_gdb.hh.

friend class HardBreakpoint
friend

Definition at line 306 of file remote_gdb.hh.

Referenced by insertHardBreak().

friend class InputEvent
friend

Definition at line 158 of file remote_gdb.hh.

Referenced by attach().

Member Data Documentation

bool BaseRemoteGDB::active
protected

Definition at line 169 of file remote_gdb.hh.

Referenced by detach(), and trap().

bool BaseRemoteGDB::attached
protected

Definition at line 170 of file remote_gdb.hh.

Referenced by attach(), detach(), isattached(), and trap().

std::map< char, GdbCommand > BaseRemoteGDB::command_map
staticprotected

Definition at line 114 of file remote_gdb.hh.

Referenced by trap().

ThreadContext* BaseRemoteGDB::context
protected
int BaseRemoteGDB::fd
protected

Definition at line 166 of file remote_gdb.hh.

Referenced by attach(), detach(), getbyte(), and putbyte().

break_map_t BaseRemoteGDB::hardBreakMap
protected

Definition at line 310 of file remote_gdb.hh.

Referenced by insertHardBreak(), and removeHardBreak().

InputEvent* BaseRemoteGDB::inputEvent
protected

Definition at line 159 of file remote_gdb.hh.

Referenced by attach(), and detach().

GDBListener* BaseRemoteGDB::listener
protected

Definition at line 161 of file remote_gdb.hh.

Referenced by debugger(), and GDBListener::GDBListener().

int BaseRemoteGDB::number
protected

Definition at line 162 of file remote_gdb.hh.

Referenced by GDBListener::listen().

BaseGdbRegCache* BaseRemoteGDB::regCachePtr
protected

Definition at line 228 of file remote_gdb.hh.

Referenced by cmd_reg_r(), cmd_reg_w(), and trap().

SingleStepEvent BaseRemoteGDB::singleStepEvent
protected

Definition at line 276 of file remote_gdb.hh.

Referenced by clearSingleStep(), and setSingleStep().

System* BaseRemoteGDB::system
protected

Definition at line 172 of file remote_gdb.hh.

Referenced by AlphaISA::RemoteGDB::acc(), getPcEventQueue(), and name().

TrapEvent BaseRemoteGDB::trapEvent
protected

Definition at line 160 of file remote_gdb.hh.


The documentation for this class was generated from the following files:

Generated on Fri Jun 9 2017 13:04:03 for gem5 by doxygen 1.8.6