gem5  v20.0.0.2
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Member Functions | Public Attributes | Private Types | Private Attributes | List of all members
Packet::PrintReqState Class Reference

Object used to maintain state of a PrintReq. More...

#include <packet.hh>

Inheritance diagram for Packet::PrintReqState:
Packet::SenderState

Classes

struct  LabelStackEntry
 An entry in the label stack. More...
 

Public Member Functions

 PrintReqState (std::ostream &os, int verbosity=0)
 
 ~PrintReqState ()
 
const std::string & curPrefix ()
 Returns the current line prefix. More...
 
void pushLabel (const std::string &lbl, const std::string &prefix=" ")
 Push a label onto the label stack, and prepend the given prefix string onto the current prefix. More...
 
void popLabel ()
 Pop a label off the label stack. More...
 
void printLabels ()
 Print all of the pending unprinted labels on the stack. More...
 
void printObj (Printable *obj)
 Print a Printable object to os, because it matched the address on a PrintReq. More...
 
- Public Member Functions inherited from Packet::SenderState
 SenderState ()
 
virtual ~SenderState ()
 

Public Attributes

std::ostream & os
 
const int verbosity
 
- Public Attributes inherited from Packet::SenderState
SenderStatepredecessor
 

Private Types

typedef std::list< LabelStackEntryLabelStack
 

Private Attributes

LabelStack labelStack
 
std::string * curPrefixPtr
 

Detailed Description

Object used to maintain state of a PrintReq.

The senderState field of a PrintReq should always be of this type.

Definition at line 408 of file packet.hh.

Member Typedef Documentation

◆ LabelStack

Definition at line 422 of file packet.hh.

Constructor & Destructor Documentation

◆ PrintReqState()

Packet::PrintReqState::PrintReqState ( std::ostream &  os,
int  verbosity = 0 
)

Definition at line 419 of file packet.cc.

References curPrefixPtr, and labelStack.

◆ ~PrintReqState()

Packet::PrintReqState::~PrintReqState ( )

Member Function Documentation

◆ curPrefix()

const std::string& Packet::PrintReqState::curPrefix ( )
inline

Returns the current line prefix.

Definition at line 437 of file packet.hh.

Referenced by AbstractMemory::functionalAccess(), and printObj().

◆ popLabel()

void Packet::PrintReqState::popLabel ( )

Pop a label off the label stack.

Definition at line 449 of file packet.cc.

References curPrefixPtr, and labelStack.

◆ printLabels()

void Packet::PrintReqState::printLabels ( )

Print all of the pending unprinted labels on the stack.

Called by printObj(), so normally not called by users unless bypassing printObj().

Definition at line 458 of file packet.cc.

References ccprintf(), ArmISA::i, labelStack, and os.

Referenced by AbstractMemory::functionalAccess(), and printObj().

◆ printObj()

void Packet::PrintReqState::printObj ( Printable obj)

Print a Printable object to os, because it matched the address on a PrintReq.

Definition at line 475 of file packet.cc.

References curPrefix(), os, Printable::print(), printLabels(), and verbosity.

◆ pushLabel()

void Packet::PrintReqState::pushLabel ( const std::string &  lbl,
const std::string &  prefix = "  " 
)

Push a label onto the label stack, and prepend the given prefix string onto the current prefix.

Labels will only be printed if an object within the label's scope is printed.

Definition at line 440 of file packet.cc.

References curPrefixPtr, labelStack, Packet::PrintReqState::LabelStackEntry::LabelStackEntry(), and Packet::PrintReqState::LabelStackEntry::prefix.

Member Data Documentation

◆ curPrefixPtr

std::string* Packet::PrintReqState::curPrefixPtr
private

Definition at line 425 of file packet.hh.

Referenced by popLabel(), PrintReqState(), pushLabel(), and ~PrintReqState().

◆ labelStack

LabelStack Packet::PrintReqState::labelStack
private

Definition at line 423 of file packet.hh.

Referenced by popLabel(), printLabels(), PrintReqState(), pushLabel(), and ~PrintReqState().

◆ os

std::ostream& Packet::PrintReqState::os

Definition at line 428 of file packet.hh.

Referenced by AbstractMemory::functionalAccess(), printLabels(), and printObj().

◆ verbosity

const int Packet::PrintReqState::verbosity

Definition at line 429 of file packet.hh.

Referenced by printObj().


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

Generated on Mon Jun 8 2020 15:45:26 for gem5 by doxygen 1.8.13