HPCToolkit
BinUtil::Exe Class Reference

#include <LM.hpp>

Inheritance diagram for BinUtil::Exe:
Collaboration diagram for BinUtil::Exe:

Public Types

enum  Type { TypeNULL = 0, TypeExe, TypeDSO }
 
enum  ReadFlg {
  ReadFlg_NULL = 0, ReadFlg_fSeg = 0x0001, ReadFlg_fProc = 0x0010, ReadFlg_fInsn = 0x0100,
  ReadFlg_ALL = ReadFlg_fSeg | ReadFlg_fProc | ReadFlg_fInsn, ReadFlg_Proc = ReadFlg_fSeg | ReadFlg_fProc, ReadFlg_Seg = ReadFlg_fSeg
}
 
enum  DumpTy {
  DUMP_Short = 0x00000000, DUMP_Mid = 0x00000110, DUMP_Mid_decode = 0x00000130, DUMP_Long = 0x11111111,
  DUMP_Long_decode = 0x11111131, DUMP_Flg_SymTab = 0x00000001, DUMP_Flg_Insn_ty = 0x00000010, DUMP_Flg_Insn_decode = 0x00000020,
  DUMP_Flg_Sym = 0x00000100
}
 
typedef VMAIntervalMap< Seg * > SegMap
 
typedef VMAIntervalMap< Proc * > ProcMap
 
typedef std::map< VMA, Insn * > InsnMap
 

Public Member Functions

 Exe ()
 
virtual ~Exe ()
 
virtual void open (const char *filenm)
 
VMA getStartVMA () const
 
virtual void dump (std::ostream &o=std::cerr, int flags=DUMP_Short, const char *pre="") const
 
virtual void dumpme (std::ostream &o=std::cerr, const char *pre="") const
 
virtual void read (const std::set< std::string > &directorySet, ReadFlg readflg)
 
const std::string & name () const
 
Type type () const
 
ReadFlg readFlags ()
 
VMA textBeg () const
 
void textBeg (VMA x)
 
VMA textEnd () const
 
void textEnd (VMA x)
 
VMA firstVMA () const
 
void firstVMA (VMA x)
 
void textBegEndVMA (VMA *begVMA, VMA *endVMA)
 
void relocate (VMA textBegReloc)
 
bool isRelocated () const
 
bool doUnrelocate (VMA loadAddr) const
 
SegMapsegs ()
 
const SegMapsegs () const
 
SegfindSeg (VMA vma) const
 
bool insertSeg (VMAInterval ival, Seg *seg)
 
uint numSegs () const
 
ProcMapprocs ()
 
const ProcMapprocs () const
 
ProcfindProc (VMA vma) const
 
bool insertProc (VMAInterval ival, Proc *proc)
 
MachInsnfindMachInsn (VMA vma, ushort &size) const
 
InsnMapinsns ()
 
const InsnMapinsns () const
 
InsnfindInsn (VMA vma, ushort opIndex) const
 
InsnfindInsnNear (VMA vma, ushort opIndex) const
 
void insertInsn (VMA vma, ushort opIndex, Insn *insn)
 
bool isPseudolLoadModule ()
 
const char * getPseudoLoadModuleName ()
 
bool functionNeverReturns (VMA addr)
 
bool findSrcCodeInfo (VMA vma, ushort opIndex, std::string &func, std::string &file, SrcFile::ln &line)
 
bool findSrcCodeInfo (VMA begVMA, ushort bOpIndex, VMA endVMA, ushort eOpIndex, std::string &func, std::string &file, SrcFile::ln &begLine, SrcFile::ln &endLine, unsigned flags=1)
 
bool findProcSrcCodeInfo (VMA vma, ushort opIndex, SrcFile::ln &line) const
 
bool realpath (std::string &filenm)
 
bfd * abfd () const
 
asymbol ** bfdSymTab () const
 
uint bfdSymTabSz () const
 
std::string toString (int flags=DUMP_Short, const char *pre="") const
 
void ddump (int code=DUMP_Long_decode) const
 
virtual void dumpProcMap (std::ostream &o=std::cerr, unsigned flag=0, const char *pre="") const
 
void ddumpProcMap (unsigned flag) const
 

Static Public Attributes

static ISAisa = NULL
 

Private Member Functions

 Exe (const Exe &e)
 
Exeoperator= (const Exe &e)
 

Private Attributes

VMA m_startVMA
 

Detailed Description

Definition at line 601 of file LM.hpp.

Member Typedef Documentation

◆ InsnMap

typedef std::map<VMA, Insn*> BinUtil::LM::InsnMap
inherited

Definition at line 139 of file LM.hpp.

◆ ProcMap

Definition at line 138 of file LM.hpp.

◆ SegMap

typedef VMAIntervalMap<Seg*> BinUtil::LM::SegMap
inherited

Definition at line 137 of file LM.hpp.

Member Enumeration Documentation

◆ DumpTy

enum BinUtil::LM::DumpTy
inherited
Enumerator
DUMP_Short 
DUMP_Mid 
DUMP_Mid_decode 
DUMP_Long 
DUMP_Long_decode 
DUMP_Flg_SymTab 
DUMP_Flg_Insn_ty 
DUMP_Flg_Insn_decode 
DUMP_Flg_Sym 

Definition at line 447 of file LM.hpp.

◆ ReadFlg

enum BinUtil::LM::ReadFlg
inherited
Enumerator
ReadFlg_NULL 
ReadFlg_fSeg 
ReadFlg_fProc 
ReadFlg_fInsn 
ReadFlg_ALL 
ReadFlg_Proc 
ReadFlg_Seg 

Definition at line 123 of file LM.hpp.

◆ Type

enum BinUtil::LM::Type
inherited
Enumerator
TypeNULL 
TypeExe 
TypeDSO 

Definition at line 118 of file LM.hpp.

Constructor & Destructor Documentation

◆ Exe() [1/2]

BinUtil::Exe::Exe ( )

Definition at line 1126 of file LM.cpp.

◆ ~Exe()

BinUtil::Exe::~Exe ( )
virtual

Definition at line 1132 of file LM.cpp.

◆ Exe() [2/2]

BinUtil::Exe::Exe ( const Exe e)
private

Member Function Documentation

◆ abfd()

bfd* BinUtil::LM::abfd ( ) const
inlineinherited

Definition at line 432 of file LM.hpp.

Here is the caller graph for this function:

◆ bfdSymTab()

asymbol** BinUtil::LM::bfdSymTab ( ) const
inlineinherited

Definition at line 436 of file LM.hpp.

◆ bfdSymTabSz()

uint BinUtil::LM::bfdSymTabSz ( ) const
inlineinherited

Definition at line 440 of file LM.hpp.

◆ ddump()

void BinUtil::LM::ddump ( int  code = DUMP_Long_decode) const
inherited

Definition at line 751 of file LM.cpp.

Here is the call graph for this function:

◆ ddumpProcMap()

void BinUtil::LM::ddumpProcMap ( unsigned  flag) const
inherited

Definition at line 781 of file LM.cpp.

Here is the call graph for this function:

◆ doUnrelocate()

bool BinUtil::LM::doUnrelocate ( VMA  loadAddr) const
inlineinherited

Definition at line 227 of file LM.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dump()

void BinUtil::Exe::dump ( std::ostream &  o = std::cerr,
int  flags = DUMP_Short,
const char *  pre = "" 
) const
virtual

Reimplemented from BinUtil::LM.

Definition at line 1150 of file LM.cpp.

Here is the call graph for this function:

◆ dumpme()

void BinUtil::Exe::dumpme ( std::ostream &  o = std::cerr,
const char *  pre = "" 
) const
virtual

Reimplemented from BinUtil::LM.

Definition at line 1157 of file LM.cpp.

Here is the call graph for this function:

◆ dumpProcMap()

void BinUtil::LM::dumpProcMap ( std::ostream &  o = std::cerr,
unsigned  flag = 0,
const char *  pre = "" 
) const
virtualinherited

Definition at line 766 of file LM.cpp.

Here is the caller graph for this function:

◆ findInsn()

Insn* BinUtil::LM::findInsn ( VMA  vma,
ushort  opIndex 
) const
inlineinherited

Definition at line 335 of file LM.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findInsnNear()

Insn* BinUtil::LM::findInsnNear ( VMA  vma,
ushort  opIndex 
) const
inlineinherited

Definition at line 347 of file LM.hpp.

Here is the call graph for this function:

◆ findMachInsn()

MachInsn * BinUtil::LM::findMachInsn ( VMA  vma,
ushort size 
) const
inherited

Definition at line 503 of file LM.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findProc()

Proc* BinUtil::LM::findProc ( VMA  vma) const
inlineinherited

Definition at line 281 of file LM.hpp.

Here is the call graph for this function:

◆ findProcSrcCodeInfo()

bool BinUtil::LM::findProcSrcCodeInfo ( VMA  vma,
ushort  opIndex,
SrcFile::ln line 
) const
inherited

Definition at line 651 of file LM.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findSeg()

Seg* BinUtil::LM::findSeg ( VMA  vma) const
inlineinherited

Definition at line 244 of file LM.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findSrcCodeInfo() [1/2]

bool BinUtil::LM::findSrcCodeInfo ( VMA  vma,
ushort  opIndex,
std::string &  func,
std::string &  file,
SrcFile::ln line 
)
inherited
Here is the caller graph for this function:

◆ findSrcCodeInfo() [2/2]

bool BinUtil::LM::findSrcCodeInfo ( VMA  begVMA,
ushort  bOpIndex,
VMA  endVMA,
ushort  eOpIndex,
std::string &  func,
std::string &  file,
SrcFile::ln begLine,
SrcFile::ln endLine,
unsigned  flags = 1 
)
inherited

◆ firstVMA() [1/2]

VMA BinUtil::LM::firstVMA ( ) const
inlineinherited

Definition at line 202 of file LM.hpp.

◆ firstVMA() [2/2]

void BinUtil::LM::firstVMA ( VMA  x)
inlineinherited

Definition at line 206 of file LM.hpp.

Here is the call graph for this function:

◆ functionNeverReturns()

bool BinUtil::LM::functionNeverReturns ( VMA  addr)
inherited

Definition at line 929 of file LM.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getPseudoLoadModuleName()

const char* BinUtil::LM::getPseudoLoadModuleName ( )
inherited
Here is the caller graph for this function:

◆ getStartVMA()

VMA BinUtil::Exe::getStartVMA ( ) const
inline

Definition at line 619 of file LM.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ insertInsn()

void BinUtil::LM::insertInsn ( VMA  vma,
ushort  opIndex,
Insn insn 
)
inlineinherited

Definition at line 359 of file LM.hpp.

Here is the call graph for this function:

◆ insertProc()

bool BinUtil::LM::insertProc ( VMAInterval  ival,
Proc proc 
)
inlineinherited

Definition at line 291 of file LM.hpp.

Here is the call graph for this function:

◆ insertSeg()

bool BinUtil::LM::insertSeg ( VMAInterval  ival,
Seg seg 
)
inlineinherited

Definition at line 255 of file LM.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ insns() [1/2]

InsnMap& BinUtil::LM::insns ( )
inlineinherited

Definition at line 327 of file LM.hpp.

◆ insns() [2/2]

const InsnMap& BinUtil::LM::insns ( ) const
inlineinherited

Definition at line 331 of file LM.hpp.

◆ isPseudolLoadModule()

bool BinUtil::LM::isPseudolLoadModule ( )
inherited
Here is the caller graph for this function:

◆ isRelocated()

bool BinUtil::LM::isRelocated ( ) const
inlineinherited

Definition at line 222 of file LM.hpp.

◆ name()

const std::string& BinUtil::LM::name ( ) const
inlineinherited

Definition at line 170 of file LM.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ numSegs()

uint BinUtil::LM::numSegs ( ) const
inlineinherited

Definition at line 264 of file LM.hpp.

Here is the caller graph for this function:

◆ open()

void BinUtil::Exe::open ( const char *  filenm)
virtual

Reimplemented from BinUtil::LM.

Definition at line 1138 of file LM.cpp.

Here is the call graph for this function:

◆ operator=()

Exe& BinUtil::Exe::operator= ( const Exe e)
private

◆ procs() [1/2]

ProcMap& BinUtil::LM::procs ( )
inlineinherited

Definition at line 273 of file LM.hpp.

Here is the caller graph for this function:

◆ procs() [2/2]

const ProcMap& BinUtil::LM::procs ( ) const
inlineinherited

Definition at line 277 of file LM.hpp.

◆ read()

void BinUtil::LM::read ( const std::set< std::string > &  directorySet,
LM::ReadFlg  readflg 
)
virtualinherited

Definition at line 460 of file LM.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readFlags()

ReadFlg BinUtil::LM::readFlags ( )
inlineinherited

Definition at line 179 of file LM.hpp.

◆ realpath()

bool BinUtil::LM::realpath ( std::string &  filenm)
inlineinherited

Definition at line 422 of file LM.hpp.

Here is the call graph for this function:

◆ relocate()

void BinUtil::LM::relocate ( VMA  textBegReloc)
inherited

Definition at line 487 of file LM.cpp.

Here is the caller graph for this function:

◆ segs() [1/2]

SegMap& BinUtil::LM::segs ( )
inlineinherited

Definition at line 236 of file LM.hpp.

Here is the caller graph for this function:

◆ segs() [2/2]

const SegMap& BinUtil::LM::segs ( ) const
inlineinherited

Definition at line 240 of file LM.hpp.

◆ textBeg() [1/2]

VMA BinUtil::LM::textBeg ( ) const
inlineinherited

Definition at line 185 of file LM.hpp.

Here is the caller graph for this function:

◆ textBeg() [2/2]

void BinUtil::LM::textBeg ( VMA  x)
inlineinherited

Definition at line 194 of file LM.hpp.

◆ textBegEndVMA()

void BinUtil::LM::textBegEndVMA ( VMA begVMA,
VMA endVMA 
)
inherited

Definition at line 676 of file LM.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ textEnd() [1/2]

VMA BinUtil::LM::textEnd ( ) const
inlineinherited

Definition at line 189 of file LM.hpp.

Here is the caller graph for this function:

◆ textEnd() [2/2]

void BinUtil::LM::textEnd ( VMA  x)
inlineinherited

Definition at line 198 of file LM.hpp.

◆ toString()

string BinUtil::LM::toString ( int  flags = DUMP_Short,
const char *  pre = "" 
) const
inherited

Definition at line 706 of file LM.cpp.

Here is the call graph for this function:

◆ type()

Type BinUtil::LM::type ( ) const
inlineinherited

Definition at line 175 of file LM.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ isa

ISA * BinUtil::LM::isa = NULL
staticinherited

Definition at line 493 of file LM.hpp.

◆ m_startVMA

VMA BinUtil::Exe::m_startVMA
private

Definition at line 639 of file LM.hpp.


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