#include <MappedFile.h>
Public Member Functions | |
| COMMON_EXPORT std::string | pathname () |
| COMMON_EXPORT std::string | filename () |
| COMMON_EXPORT void * | base_addr () |
| COMMON_EXPORT int | getFD () |
| COMMON_EXPORT unsigned long | size () |
| COMMON_EXPORT MappedFile * | clone () |
| COMMON_EXPORT void | setSharing (bool s) |
| COMMON_EXPORT bool | canBeShared () |
Static Public Member Functions | |
| static COMMON_EXPORT MappedFile * | createMappedFile (std::string fullpath_) |
| static COMMON_EXPORT MappedFile * | createMappedFile (void *map_loc, unsigned long size_, const std::string &name) |
| static COMMON_EXPORT void | closeMappedFile (MappedFile *&mf) |
Private Member Functions | |
| MappedFile (std::string fullpath_, bool &ok) | |
| MappedFile (void *loc, unsigned long size_, const std::string &name, bool &ok) | |
| ~MappedFile () | |
| bool | clean_up () |
| bool | check_path (std::string &) |
| bool | open_file () |
| bool | open_file (void *, unsigned long size_=0) |
| bool | map_file () |
| bool | unmap_file () |
| bool | close_file () |
Private Attributes | |
| std::string | fullpath |
| void * | map_addr |
| int | fd |
| bool | remote_file |
| bool | did_mmap |
| bool | did_open |
| bool | can_share |
| unsigned long | file_size |
| int | refCount |
Static Private Attributes | |
| static dyn_hash_map < std::string, MappedFile * > | mapped_files |
Definition at line 38 of file MappedFile.h.
| MappedFile::MappedFile | ( | std::string | fullpath_, | |
| bool & | ok | |||
| ) | [private] |
Definition at line 103 of file MappedFile.C.
References check_path(), fullpath, map_file(), and open_file().
Referenced by createMappedFile().
| MappedFile::MappedFile | ( | void * | loc, | |
| unsigned long | size_, | |||
| const std::string & | name, | |||
| bool & | ok | |||
| ) | [private] |
Definition at line 141 of file MappedFile.C.
References file_size, map_addr, and open_file().
| MappedFile::~MappedFile | ( | ) | [private] |
Definition at line 210 of file MappedFile.C.
References close_file(), did_mmap, did_open, and unmap_file().
| COMMON_EXPORT void* MappedFile::base_addr | ( | ) | [inline] |
Definition at line 48 of file MappedFile.h.
References map_addr.
Referenced by Dyninst::SymtabAPI::Object::AddTLSFunctions(), Dyninst::SymtabAPI::Object::find_code_and_data(), Dyninst::SymtabAPI::Object::FindInterestingSections(), Dyninst::SymtabAPI::Object::get_base_addr(), Dyninst::SymtabAPI::Object::get_stab_info(), Dyninst::SymtabAPI::Object::getHintNameTable(), Dyninst::SymtabAPI::Object::getImportDescriptorTable(), Dyninst::SymtabAPI::Object::GetMapAddr(), Dyninst::SymtabAPI::Object::loaded_elf(), Dyninst::SymtabAPI::Symtab::mem_image(), Dyninst::SymtabAPI::Object::mem_image(), Dyninst::SymtabAPI::Object::Object(), Dyninst::SymtabAPI::Object::ParseGlobalSymbol(), and Dyninst::SymtabAPI::Object::ParseSymbolInfo().
| bool MappedFile::canBeShared | ( | ) |
Definition at line 450 of file MappedFile.C.
References can_share.
Referenced by Dyninst::SymtabAPI::Symtab::canBeShared(), and Dyninst::SymtabAPI::Symtab::findOpenSymtab().
| bool MappedFile::check_path | ( | std::string & | filename | ) | [private] |
| bool MappedFile::clean_up | ( | ) | [private] |
Definition at line 194 of file MappedFile.C.
References close_file(), did_mmap, did_open, FILE__, fprintf, fullpath, and unmap_file().
| COMMON_EXPORT MappedFile* MappedFile::clone | ( | ) | [inline] |
Definition at line 55 of file MappedFile.h.
References refCount.
| bool MappedFile::close_file | ( | ) | [private] |
Definition at line 414 of file MappedFile.C.
References fd, FILE__, fprintf, and remote_file.
Referenced by clean_up(), and ~MappedFile().
| void MappedFile::closeMappedFile | ( | MappedFile *& | mf | ) | [static] |
Definition at line 165 of file MappedFile.C.
References FILE__, fprintf, mapped_files, pathname(), and refCount.
Referenced by Dyninst::SymtabAPI::Archive::~Archive(), and Dyninst::SymtabAPI::Symtab::~Symtab().
| MappedFile * MappedFile::createMappedFile | ( | void * | map_loc, | |
| unsigned long | size_, | |||
| const std::string & | name | |||
| ) | [static] |
Definition at line 128 of file MappedFile.C.
References MappedFile().
| MappedFile * MappedFile::createMappedFile | ( | std::string | fullpath_ | ) | [static] |
Definition at line 37 of file MappedFile.C.
References can_share, fd, map_addr, mapped_files, MappedFile(), refCount, and remote_file.
Referenced by Dyninst::SymtabAPI::Symtab::Symtab().
| std::string MappedFile::filename | ( | ) |
Definition at line 440 of file MappedFile.C.
References extract_pathname_tail(), and fullpath.
Referenced by Dyninst::SymtabAPI::Object::FindInterestingSections(), Dyninst::SymtabAPI::Symtab::getDynLibSubstitution(), Dyninst::SymtabAPI::Object::getFileName(), Dyninst::SymtabAPI::Symtab::isCode(), Dyninst::SymtabAPI::Symtab::isData(), Dyninst::SymtabAPI::Symtab::name(), Dyninst::SymtabAPI::Archive::name(), Dyninst::SymtabAPI::Object::Object(), Dyninst::SymtabAPI::Object::ParseSymbolInfo(), and Dyninst::SymtabAPI::Symtab::Symtab().
| COMMON_EXPORT int MappedFile::getFD | ( | ) | [inline] |
Definition at line 52 of file MappedFile.h.
References fd.
Referenced by Dyninst::SymtabAPI::Object::Object().
| bool MappedFile::map_file | ( | ) | [private] |
Definition at line 313 of file MappedFile.C.
References did_mmap, fd, file_size, and map_addr.
Referenced by MappedFile().
| bool MappedFile::open_file | ( | void * | loc, | |
| unsigned long | size_ = 0 | |||
| ) | [private] |
| bool MappedFile::open_file | ( | ) | [private] |
Definition at line 280 of file MappedFile.C.
References did_open, fd, FILE__, fprintf, fullpath, and INVALID_HANDLE_VALUE.
Referenced by MappedFile().
| std::string MappedFile::pathname | ( | ) |
Definition at line 435 of file MappedFile.C.
References fullpath.
Referenced by Dyninst::SymtabAPI::Symtab::addLine(), closeMappedFile(), Dyninst::SymtabAPI::Symtab::file(), Dyninst::SymtabAPI::Object::load_object(), Dyninst::SymtabAPI::Object::load_shared_object(), Dyninst::SymtabAPI::Object::Object(), and Dyninst::SymtabAPI::Object::parse_aout().
| void MappedFile::setSharing | ( | bool | s | ) |
Definition at line 445 of file MappedFile.C.
References can_share.
Referenced by Dyninst::SymtabAPI::Symtab::emit().
| COMMON_EXPORT unsigned long MappedFile::size | ( | ) | [inline] |
Definition at line 54 of file MappedFile.h.
References file_size.
Referenced by Dyninst::SymtabAPI::Object::FindInterestingSections(), and Dyninst::SymtabAPI::Object::Object().
| bool MappedFile::unmap_file | ( | ) | [private] |
Definition at line 391 of file MappedFile.C.
References FILE__, file_size, fprintf, map_addr, and remote_file.
Referenced by clean_up(), and ~MappedFile().
bool MappedFile::can_share [private] |
Definition at line 87 of file MappedFile.h.
Referenced by canBeShared(), createMappedFile(), and setSharing().
bool MappedFile::did_mmap [private] |
Definition at line 85 of file MappedFile.h.
Referenced by clean_up(), map_file(), and ~MappedFile().
bool MappedFile::did_open [private] |
Definition at line 86 of file MappedFile.h.
Referenced by clean_up(), open_file(), and ~MappedFile().
int MappedFile::fd [private] |
Definition at line 81 of file MappedFile.h.
Referenced by close_file(), createMappedFile(), getFD(), map_file(), and open_file().
unsigned long MappedFile::file_size [private] |
Definition at line 88 of file MappedFile.h.
Referenced by check_path(), map_file(), MappedFile(), open_file(), size(), and unmap_file().
std::string MappedFile::fullpath [private] |
Definition at line 74 of file MappedFile.h.
Referenced by clean_up(), filename(), MappedFile(), open_file(), and pathname().
void* MappedFile::map_addr [private] |
Definition at line 75 of file MappedFile.h.
Referenced by base_addr(), createMappedFile(), map_file(), MappedFile(), open_file(), and unmap_file().
dyn_hash_map< std::string, MappedFile * > MappedFile::mapped_files [static, private] |
Definition at line 39 of file MappedFile.h.
Referenced by closeMappedFile(), and createMappedFile().
int MappedFile::refCount [private] |
Definition at line 89 of file MappedFile.h.
Referenced by clone(), closeMappedFile(), and createMappedFile().
bool MappedFile::remote_file [private] |
Definition at line 84 of file MappedFile.h.
Referenced by close_file(), createMappedFile(), and unmap_file().
1.6.1