Make your own free website on Tripod.com
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

RelocationInfos Class Reference

#include <relocationinfo.h>

List of all members.

Public Methods

void AddRelocation (const Relocation &rel, vma_t address)
const RelocationGetRelocation (vma_t address, unsigned bytes) const
 return relocation at a given address. More...

const RelocationGetRelocation (vma_t address) const

Static Public Attributes

const Relocation relError
 Hold relocation info for returning error. More...


Private Types

typedef std::set< vma_t, std::less<
vma_t > > 
t_relocations

Private Attributes

t_relocations relocations


Member Typedef Documentation

typedef std::set<vma_t,std::less<vma_t> > RelocationInfos::t_relocations [private]
 

Definition at line 59 of file relocationinfo.h.


Member Function Documentation

void RelocationInfos::AddRelocation const Relocation   rel,
vma_t    address
 

Definition at line 32 of file relocationinfo.cpp.

References _PRG_ASSERT, Relocation::GetType(), Relocation::relNone, relocations, Relocation::relRelative, and vma_t.

Referenced by AddRelocationInfo().

00033 {
00034   _PRG_ASSERT(rel.GetType() == Relocation::relNone ||
00035     rel.GetType() == Relocation::relRelative);
00036   if ( rel.GetType() != Relocation::relNone )
00037     relocations.insert(address);
00038 }

const Relocation * RelocationInfos::GetRelocation vma_t    address const
 

Definition at line 56 of file relocationinfo.cpp.

References relError, relocations, and vma_t.

00057 {
00058   // !!! memoriazzre ultimo byte per rilocazioni ?
00059   t_relocations::const_iterator i = relocations.lower_bound(address-3);
00060   if ( i == relocations.end() )
00061     return NULL;
00062   if ( *i == address)
00063     return &relRelative;
00064   if ( (address - *i) < 4 ) // !!! constants !!!
00065     return &relError;
00066   return NULL;
00067 }

const Relocation * RelocationInfos::GetRelocation vma_t    address,
unsigned    bytes
const
 

return relocation at a given address.

Returns:
Valid relocation pointer or &RelocationInfos::relError

Definition at line 42 of file relocationinfo.cpp.

References relError, relocations, and vma_t.

Referenced by CodeParser::ExecuteComplexReferenceMemory(), CodeParser::GetStringStats(), InstructionDecoder::getv_rel(), and CodeParser::Parse().

00043 {
00044   t_relocations::const_iterator i = relocations.lower_bound(address);
00045   if ( i == relocations.end() )
00046     return NULL;
00047 
00048   if ( *i == address && bytes == 4 ) // !!! constants !!!
00049     // la rilocazione e' ok!
00050                 return &relRelative;
00051   else if ( address+bytes > *i )
00052                 return &relError;
00053         return NULL;
00054 }


Member Data Documentation

const Relocation RelocationInfos::relError [static]
 

Hold relocation info for returning error.

Referenced by GetRelocation(), InstructionDecoder::getv_rel(), and CodeParser::Parse().

t_relocations RelocationInfos::relocations [private]
 

Definition at line 60 of file relocationinfo.h.

Referenced by AddRelocation(), and GetRelocation().


The documentation for this class was generated from the following files:
Generated on Mon Jan 13 22:20:37 2003 for perdr by doxygen1.2.15