Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
bloaty::RangeMap Class Reference

#include <range_map.h>

Classes

struct  Entry
 

Public Member Functions

void AddDualRange (uint64_t addr, uint64_t size, uint64_t otheraddr, const std::string &val)
 
void AddRange (uint64_t addr, uint64_t size, const std::string &val)
 
bool AddRangeWithTranslation (uint64_t addr, uint64_t size, const std::string &val, const RangeMap &translator, bool verbose, RangeMap *other)
 
void Compress ()
 
bool CoversRange (uint64_t addr, uint64_t size) const
 
std::string DebugString () const
 
template<class T >
std::string EntryDebugString (T it) const
 
template<class Func >
void ForEachRange (Func func) const
 
template<class Func >
void ForEachRangeWithStart (uint64_t start, Func func) const
 
uint64_t GetMaxAddress () const
 
RangeMapoperator= (RangeMap &&other)=default
 
RangeMapoperator= (RangeMap &other)=delete
 
 RangeMap ()=default
 
 RangeMap (RangeMap &&other)=default
 
 RangeMap (RangeMap &other)=delete
 
bool Translate (uint64_t addr, uint64_t *translated) const
 
bool TryGetLabel (uint64_t addr, std::string *label) const
 
bool TryGetLabelForRange (uint64_t addr, uint64_t size, std::string *label) const
 
bool TryGetSize (uint64_t addr, uint64_t *size) const
 

Static Public Member Functions

template<class Func >
static void ComputeRollup (const std::vector< const RangeMap * > &range_maps, Func func)
 
static std::string EntryDebugString (uint64_t addr, uint64_t size, uint64_t other_start, const std::string &label)
 

Static Public Attributes

static constexpr uint64_t kUnknownSize = UINT64_MAX
 

Private Types

typedef std::map< uint64_t, EntryMap
 

Private Member Functions

template<class T >
void CheckConsistency (T iter) const
 
template<class T >
bool EntryContains (T iter, uint64_t addr) const
 
template<class T >
bool EntryContainsStrict (T iter, uint64_t addr) const
 
Map::const_iterator FindContaining (uint64_t addr) const
 
Map::iterator FindContainingOrAfter (uint64_t addr)
 
Map::const_iterator FindContainingOrAfter (uint64_t addr) const
 
bool IterIsEnd (Map::const_iterator iter) const
 
template<class T >
void MaybeSetLabel (T iter, const std::string &label, uint64_t addr, uint64_t end)
 
uint64_t RangeEnd (Map::const_iterator iter) const
 
uint64_t RangeEndUnknownLimit (Map::const_iterator iter, uint64_t unknown) const
 
template<class T >
bool TranslateAndTrimRangeWithEntry (T iter, uint64_t addr, uint64_t size, uint64_t *trimmed_addr, uint64_t *translated_addr, uint64_t *trimmed_size) const
 
template<class T >
uint64_t TranslateWithEntry (T iter, uint64_t addr) const
 

Private Attributes

Map mappings_
 

Static Private Attributes

static const uint64_t kNoTranslation = UINT64_MAX
 

Friends

class RangeMapTest
 

Detailed Description

Definition at line 46 of file range_map.h.

Member Typedef Documentation

◆ Map

Definition at line 176 of file range_map.h.

Constructor & Destructor Documentation

◆ RangeMap() [1/3]

bloaty::RangeMap::RangeMap ( )
default

◆ RangeMap() [2/3]

bloaty::RangeMap::RangeMap ( RangeMap &&  other)
default

◆ RangeMap() [3/3]

bloaty::RangeMap::RangeMap ( RangeMap other)
delete

Member Function Documentation

◆ AddDualRange()

void bloaty::RangeMap::AddDualRange ( uint64_t  addr,
uint64_t  size,
uint64_t  otheraddr,
const std::string &  val 
)

Definition at line 181 of file range_map.cc.

◆ AddRange()

void bloaty::RangeMap::AddRange ( uint64_t  addr,
uint64_t  size,
const std::string &  val 
)

Definition at line 146 of file range_map.cc.

◆ AddRangeWithTranslation()

bool bloaty::RangeMap::AddRangeWithTranslation ( uint64_t  addr,
uint64_t  size,
const std::string &  val,
const RangeMap translator,
bool  verbose,
RangeMap other 
)

Definition at line 253 of file range_map.cc.

◆ CheckConsistency()

template<class T >
void bloaty::RangeMap::CheckConsistency ( T  iter) const
inlineprivate

Definition at line 180 of file range_map.h.

◆ Compress()

void bloaty::RangeMap::Compress ( )

Definition at line 291 of file range_map.cc.

◆ ComputeRollup()

template<class Func >
void bloaty::RangeMap::ComputeRollup ( const std::vector< const RangeMap * > &  range_maps,
Func  func 
)
static

Definition at line 251 of file range_map.h.

◆ CoversRange()

bool bloaty::RangeMap::CoversRange ( uint64_t  addr,
uint64_t  size 
) const

Definition at line 307 of file range_map.cc.

◆ DebugString()

std::string bloaty::RangeMap::DebugString ( ) const

Definition at line 138 of file range_map.cc.

◆ EntryContains()

template<class T >
bool bloaty::RangeMap::EntryContains ( T  iter,
uint64_t  addr 
) const
inlineprivate

Definition at line 189 of file range_map.h.

◆ EntryContainsStrict()

template<class T >
bool bloaty::RangeMap::EntryContainsStrict ( T  iter,
uint64_t  addr 
) const
inlineprivate

Definition at line 194 of file range_map.h.

◆ EntryDebugString() [1/2]

template<class T >
std::string bloaty::RangeMap::EntryDebugString ( T  it) const
inline

Definition at line 124 of file range_map.h.

◆ EntryDebugString() [2/2]

static std::string bloaty::RangeMap::EntryDebugString ( uint64_t  addr,
uint64_t  size,
uint64_t  other_start,
const std::string &  label 
)
inlinestatic

Definition at line 110 of file range_map.h.

◆ FindContaining()

RangeMap::Map::const_iterator bloaty::RangeMap::FindContaining ( uint64_t  addr) const
private

Definition at line 57 of file range_map.cc.

◆ FindContainingOrAfter() [1/2]

RangeMap::Map::iterator bloaty::RangeMap::FindContainingOrAfter ( uint64_t  addr)
private

Definition at line 66 of file range_map.cc.

◆ FindContainingOrAfter() [2/2]

RangeMap::Map::const_iterator bloaty::RangeMap::FindContainingOrAfter ( uint64_t  addr) const
private

Definition at line 76 of file range_map.cc.

◆ ForEachRange()

template<class Func >
void bloaty::RangeMap::ForEachRange ( Func  func) const
inline

Definition at line 138 of file range_map.h.

◆ ForEachRangeWithStart()

template<class Func >
void bloaty::RangeMap::ForEachRangeWithStart ( uint64_t  start,
Func  func 
) const
inline

Definition at line 145 of file range_map.h.

◆ GetMaxAddress()

uint64_t bloaty::RangeMap::GetMaxAddress ( ) const

Definition at line 323 of file range_map.cc.

◆ IterIsEnd()

bool bloaty::RangeMap::IterIsEnd ( Map::const_iterator  iter) const
inlineprivate

Definition at line 227 of file range_map.h.

◆ MaybeSetLabel()

template<class T >
void bloaty::RangeMap::MaybeSetLabel ( T  iter,
const std::string &  label,
uint64_t  addr,
uint64_t  end 
)
private

Definition at line 151 of file range_map.cc.

◆ operator=() [1/2]

RangeMap& bloaty::RangeMap::operator= ( RangeMap &&  other)
default

◆ operator=() [2/2]

RangeMap& bloaty::RangeMap::operator= ( RangeMap other)
delete

◆ RangeEnd()

uint64_t bloaty::RangeMap::RangeEnd ( Map::const_iterator  iter) const
inlineprivate

Definition at line 223 of file range_map.h.

◆ RangeEndUnknownLimit()

uint64_t bloaty::RangeMap::RangeEndUnknownLimit ( Map::const_iterator  iter,
uint64_t  unknown 
) const
inlineprivate

Definition at line 207 of file range_map.h.

◆ Translate()

bool bloaty::RangeMap::Translate ( uint64_t  addr,
uint64_t translated 
) const

Definition at line 87 of file range_map.cc.

◆ TranslateAndTrimRangeWithEntry()

template<class T >
bool bloaty::RangeMap::TranslateAndTrimRangeWithEntry ( T  iter,
uint64_t  addr,
uint64_t  size,
uint64_t trimmed_addr,
uint64_t translated_addr,
uint64_t trimmed_size 
) const
private

Definition at line 31 of file range_map.cc.

◆ TranslateWithEntry()

template<class T >
uint64_t bloaty::RangeMap::TranslateWithEntry ( T  iter,
uint64_t  addr 
) const
private

Definition at line 24 of file range_map.cc.

◆ TryGetLabel()

bool bloaty::RangeMap::TryGetLabel ( uint64_t  addr,
std::string *  label 
) const

Definition at line 97 of file range_map.cc.

◆ TryGetLabelForRange()

bool bloaty::RangeMap::TryGetLabelForRange ( uint64_t  addr,
uint64_t  size,
std::string *  label 
) const

Definition at line 107 of file range_map.cc.

◆ TryGetSize()

bool bloaty::RangeMap::TryGetSize ( uint64_t  addr,
uint64_t size 
) const

Definition at line 128 of file range_map.cc.

Friends And Related Function Documentation

◆ RangeMapTest

friend class RangeMapTest
friend

Definition at line 157 of file range_map.h.

Member Data Documentation

◆ kNoTranslation

const uint64_t bloaty::RangeMap::kNoTranslation = UINT64_MAX
staticprivate

Definition at line 158 of file range_map.h.

◆ kUnknownSize

constexpr uint64_t bloaty::RangeMap::kUnknownSize = UINT64_MAX
staticconstexpr

Definition at line 154 of file range_map.h.

◆ mappings_

Map bloaty::RangeMap::mappings_
private

Definition at line 177 of file range_map.h.


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


grpc
Author(s):
autogenerated on Fri May 16 2025 03:02:58