#include <windows.h>#include <cvconst.h>#include <oleauto.h>#include <dbghelp.h>#include <iostream>#include <iomanip>#include <limits.h>#include <crtdbg.h>#include <winnt.h>#include "symtabAPI/src/Object.h"#include "symtabAPI/src/Object-nt.h"#include "LineInformation.h"#include "Collections.h"#include "Symtab.h"#include "Module.h"#include "Function.h"#include "Variable.h"#include "emitWin.h"#include "common/h/headers.h"Go to the source code of this file.
Data Structures | |
| struct | CompareSymAddresses |
| struct | line_info_tmp_t |
| struct | line_info_tmp_lt |
| struct | localsStruct |
| struct | proc_mod_pair |
Defines | |
| #define | WIN32_LEAN_AND_MEAN |
| #define | SymTagFunction 0x5 |
| #define | SymTagData 0x7 |
| #define | SymTagPublicSymbol 0xa |
| #define | SymTagMisc 0x3808 |
Typedefs | |
| typedef std::multiset < line_info_tmp_t, line_info_tmp_lt > | info_for_file_t |
| typedef std::map< std::string, info_for_file_t * > | info_for_all_files_t |
Functions | |
| Type * | getType (HANDLE p, Offset mod_base, int typeIndex, Module *mod=NULL) |
| std::string | convertCharToString (const char *ptr) |
| static void | printSysError (unsigned errNo) |
| BOOL CALLBACK | SymEnumSymbolsCallback (PSYMBOL_INFO pSymInfo, ULONG symSize, PVOID userContext) |
| static void | stripAtSuffix (char *str) |
| char * | cplus_demangle (char *c, int, bool includeTypes) |
| static BOOL | isGlobalSymbol (PSYMBOL_INFO pSymInfo) |
| Region::perm_t | getRegionPerms (DWORD flags) |
| Region::RegionType | getRegionType (DWORD flags) |
| void | fixup_filename (std::string &filename) |
| static BOOL CALLBACK | add_line_info (SRCCODEINFO *srcinfo, void *param) |
| static bool | store_line_info (dyn_hash_map< std::string, LineInformation > *lineInfo, info_for_all_files_t *baseInfo) |
| Dyninst::MachRegister | WinConvert (Register reg) |
| BOOL CALLBACK | enumLocalSymbols (PSYMBOL_INFO pSymInfo, unsigned long symSize, void *userContext) |
| static void | enumLocalVars (Function *func, localsStruct *locals) |
| static int | variantValue (VARIANT *v) |
| static void | addTypeToCollection (Type *type, Module *mod) |
| static char * | getTypeName (HANDLE p, Offset base, int typeIndex) |
| static dataClass | getDataClass (HANDLE p, Offset base, int typeIndex) |
| static Type * | getEnumType (HANDLE p, Offset base, int typeIndex, Module *mod) |
| static Type * | getPointerType (HANDLE p, Offset base, int typeIndex, Module *mod) |
| static Type * | getArrayType (HANDLE p, Offset base, int typeIndex, Module *mod) |
| static Type * | getTypedefType (HANDLE p, Offset base, int typeIndex, Module *mod) |
| static Type * | getUDTType (HANDLE p, Offset base, int typeIndex, Module *mod) |
| static Type * | getLayeredType (HANDLE p, Offset base, int typeIndex, Module *mod) |
| static Type * | getFunctionType (HANDLE p, Offset base, int typeIndex, Module *mod) |
| static Type * | getBaseType (HANDLE p, Offset base, int typeIndex, Module *mod) |
| static void | findLocalVars (Function *func, proc_mod_pair base) |
| BOOL CALLBACK | add_type_info (PSYMBOL_INFO pSymInfo, ULONG SymbolSize, void *info) |
Variables | |
| bool | pd_debug_export_symbols = false |
| #define SymTagData 0x7 |
Definition at line 446 of file Object-nt.C.
Referenced by getType(), and isGlobalSymbol().
| #define SymTagFunction 0x5 |
Definition at line 445 of file Object-nt.C.
Referenced by getDataClass(), getType(), isGlobalSymbol(), and Dyninst::SymtabAPI::Object::ParseGlobalSymbol().
| #define SymTagMisc 0x3808 |
Definition at line 448 of file Object-nt.C.
Referenced by isGlobalSymbol().
| #define SymTagPublicSymbol 0xa |
Definition at line 447 of file Object-nt.C.
Referenced by isGlobalSymbol().
| #define WIN32_LEAN_AND_MEAN |
Definition at line 31 of file Object-nt.C.
| typedef std::map<std::string, info_for_file_t*> info_for_all_files_t |
Definition at line 1143 of file Object-nt.C.
| typedef std::multiset<line_info_tmp_t, line_info_tmp_lt> info_for_file_t |
Definition at line 1142 of file Object-nt.C.
| static BOOL CALLBACK add_line_info | ( | SRCCODEINFO * | srcinfo, | |
| void * | param | |||
| ) | [static] |
Definition at line 1145 of file Object-nt.C.
Referenced by Dyninst::SymtabAPI::Object::parseFileLineInfo().
| BOOL CALLBACK add_type_info | ( | PSYMBOL_INFO | pSymInfo, | |
| ULONG | SymbolSize, | |||
| void * | info | |||
| ) |
Definition at line 2064 of file Object-nt.C.
References Dyninst::SymtabAPI::typeCollection::addGlobalVariable(), proc_mod_pair::base_addr, Dyninst::SymtabAPI::Module::fileName(), Dyninst::SymtabAPI::Symtab::findFuncByEntryOffset(), Dyninst::SymtabAPI::Symtab::findVariableByOffset(), Dyninst::SymtabAPI::Symtab::getAllModules(), Dyninst::SymtabAPI::typeCollection::getModTypeCollection(), Dyninst::SymtabAPI::Aggregate::getModule(), getType(), proc_mod_pair::handle, Dyninst::SymtabAPI::Symtab::isExec(), isGlobalSymbol(), proc_mod_pair::obj, and Dyninst::SymtabAPI::Variable::setType().
Definition at line 1422 of file Object-nt.C.
References Dyninst::SymtabAPI::typeCollection::addType(), and Dyninst::SymtabAPI::typeCollection::getModTypeCollection().
Referenced by getArrayType(), getBaseType(), getEnumType(), getFunctionType(), getPointerType(), getTypedefType(), and getUDTType().
| std::string convertCharToString | ( | const char * | ptr | ) |
Definition at line 67 of file Object-nt.C.
Referenced by enumLocalSymbols(), getEnumType(), getTypedefType(), getUDTType(), parseArrayDef(), parseCPlusPlusInfo(), parseFieldList(), parseRangeType(), parseRefType(), and parseTypeDef().
| char* cplus_demangle | ( | char * | c, | |
| int | , | |||
| bool | includeTypes | |||
| ) |
Definition at line 120 of file Object-nt.C.
References P_strdup(), and stripAtSuffix().
| BOOL CALLBACK enumLocalSymbols | ( | PSYMBOL_INFO | pSymInfo, | |
| unsigned long | symSize, | |||
| void * | userContext | |||
| ) |
Definition at line 1238 of file Object-nt.C.
References Dyninst::SymtabAPI::Function::addLocalVar(), Dyninst::SymtabAPI::Function::addParam(), localsStruct::base, convertCharToString(), FILE__, Dyninst::SymtabAPI::Module::fileName(), localsStruct::foundSyms, fprintf, Dyninst::VariableLocation::frameOffset, localsStruct::func, Dyninst::SymtabAPI::Aggregate::getAllPrettyNames(), Dyninst::SymtabAPI::Aggregate::getModule(), Dyninst::SymtabAPI::Type::getName(), getType(), Dyninst::VariableLocation::hiPC, Dyninst::VariableLocation::lowPC, Dyninst::VariableLocation::mr_reg, localsStruct::p, Dyninst::VariableLocation::refClass, Dyninst::VariableLocation::stClass, Dyninst::storageAddr, Dyninst::storageNoRef, Dyninst::storageReg, Dyninst::storageRegOffset, and WinConvert().
Referenced by enumLocalVars().
| static void enumLocalVars | ( | Function * | func, | |
| localsStruct * | locals | |||
| ) | [static] |
Definition at line 1346 of file Object-nt.C.
References localsStruct::base, enumLocalSymbols(), Dyninst::SymtabAPI::Aggregate::getOffset(), Dyninst::SymtabAPI::Function::getSize(), and localsStruct::p.
Referenced by findLocalVars().
| static void findLocalVars | ( | Function * | func, | |
| proc_mod_pair | base | |||
| ) | [static] |
Definition at line 2041 of file Object-nt.C.
References localsStruct::base, proc_mod_pair::base_addr, enumLocalVars(), localsStruct::func, Dyninst::SymtabAPI::Aggregate::getModule(), proc_mod_pair::handle, and localsStruct::p.
| void fixup_filename | ( | std::string & | filename | ) |
Definition at line 1088 of file Object-nt.C.
Referenced by Dyninst::SymtabAPI::Symtab::Symtab().
Definition at line 1578 of file Object-nt.C.
References addTypeToCollection(), fprintf, Dyninst::SymtabAPI::Type::getID(), Dyninst::SymtabAPI::Type::getName(), Dyninst::SymtabAPI::Type::getSize(), and getType().
Referenced by getType().
Definition at line 1844 of file Object-nt.C.
References addTypeToCollection(), and fprintf.
Referenced by getType().
| static dataClass getDataClass | ( | HANDLE | p, | |
| Offset | base, | |||
| int | typeIndex | |||
| ) | [static] |
Definition at line 1457 of file Object-nt.C.
References Dyninst::SymtabAPI::dataArray, Dyninst::SymtabAPI::dataEnum, Dyninst::SymtabAPI::dataFunction, Dyninst::SymtabAPI::dataPointer, Dyninst::SymtabAPI::dataScalar, Dyninst::SymtabAPI::dataStructure, Dyninst::SymtabAPI::dataTypedef, Dyninst::SymtabAPI::dataUnion, Dyninst::SymtabAPI::dataUnknownType, and SymTagFunction.
Definition at line 1502 of file Object-nt.C.
References Dyninst::SymtabAPI::typeEnum::addConstant(), addTypeToCollection(), convertCharToString(), getTypeName(), and variantValue().
Referenced by getType().
Definition at line 1769 of file Object-nt.C.
References Dyninst::SymtabAPI::typeFunction::addParam(), addTypeToCollection(), fprintf, Dyninst::SymtabAPI::Type::getName(), getType(), Dyninst::SymtabAPI::Type::setName(), and Dyninst::SymtabAPI::typeFunction::setRetType().
Referenced by getType().
Definition at line 1755 of file Object-nt.C.
References fprintf, and getType().
Referenced by getType().
Definition at line 1549 of file Object-nt.C.
References addTypeToCollection(), fprintf, getType(), and Dyninst::SymtabAPI::typePointer::setPtr().
Referenced by getType().
| Region::perm_t getRegionPerms | ( | DWORD | flags | ) |
Definition at line 723 of file Object-nt.C.
References Dyninst::SymtabAPI::Region::RP_R, Dyninst::SymtabAPI::Region::RP_RW, Dyninst::SymtabAPI::Region::RP_RWX, and Dyninst::SymtabAPI::Region::RP_RX.
| Region::RegionType getRegionType | ( | DWORD | flags | ) |
Definition at line 734 of file Object-nt.C.
References Dyninst::SymtabAPI::Region::RT_DATA, Dyninst::SymtabAPI::Region::RT_OTHER, Dyninst::SymtabAPI::Region::RT_TEXT, and Dyninst::SymtabAPI::Region::RT_TEXTDATA.
Definition at line 1949 of file Object-nt.C.
References Dyninst::SymtabAPI::typeCollection::findType(), fprintf, getArrayType(), getBaseType(), getEnumType(), getFunctionType(), Dyninst::SymtabAPI::Type::getID(), getLayeredType(), Dyninst::SymtabAPI::typeCollection::getModTypeCollection(), getPointerType(), getTypedefType(), getUDTType(), Dyninst::SymtabAPI::Symtab::stdTypes(), SymTagData, and SymTagFunction.
Referenced by add_type_info(), Dyninst::SymtabAPI::typeCommon::endCommonBlock(), enumLocalSymbols(), Dyninst::SymtabAPI::Symtab::getAllSymbolsByType(), getArrayType(), getFunctionType(), getLayeredType(), getPointerType(), getTypedefType(), getUDTType(), Dyninst::SymtabAPI::Object::parse_aout(), printSyms(), Dyninst::SymtabAPI::typeUnion::updateSize(), and Dyninst::SymtabAPI::typeStruct::updateSize().
Definition at line 1624 of file Object-nt.C.
References addTypeToCollection(), convertCharToString(), fprintf, getType(), and getTypeName().
Referenced by getType().
| static char* getTypeName | ( | HANDLE | p, | |
| Offset | base, | |||
| int | typeIndex | |||
| ) | [static] |
Definition at line 1437 of file Object-nt.C.
Referenced by Dyninst::AnnotatableSparse::annotationsReport(), Dyninst::AnnotatableDense::annotationsReport(), getEnumType(), getTypedefType(), and getUDTType().
Definition at line 1646 of file Object-nt.C.
References Dyninst::SymtabAPI::fieldListType::addField(), addTypeToCollection(), convertCharToString(), fprintf, Dyninst::SymtabAPI::Type::getName(), Dyninst::SymtabAPI::Type::getSize(), getType(), getTypeName(), and P_strdup().
Referenced by getType().
| static BOOL isGlobalSymbol | ( | PSYMBOL_INFO | pSymInfo | ) | [static] |
Definition at line 459 of file Object-nt.C.
References SYMFLAG_EXPORT, SYMFLAG_FUNCTION, SymTagData, SymTagFunction, SymTagMisc, and SymTagPublicSymbol.
Referenced by add_type_info(), and SymEnumSymbolsCallback().
| static void printSysError | ( | unsigned | errNo | ) | [static] |
Definition at line 76 of file Object-nt.C.
References fprintf, and printSysError().
| static bool store_line_info | ( | dyn_hash_map< std::string, LineInformation > * | lineInfo, | |
| info_for_all_files_t * | baseInfo | |||
| ) | [static] |
Definition at line 1161 of file Object-nt.C.
Referenced by Dyninst::SymtabAPI::Object::parseFileLineInfo().
| static void stripAtSuffix | ( | char * | str | ) | [static] |
Definition at line 104 of file Object-nt.C.
Referenced by cplus_demangle().
| BOOL CALLBACK SymEnumSymbolsCallback | ( | PSYMBOL_INFO | pSymInfo, | |
| ULONG | symSize, | |||
| PVOID | userContext | |||
| ) |
Definition at line 539 of file Object-nt.C.
References fprintf, isGlobalSymbol(), Dyninst::SymtabAPI::Object::ParseGlobalSymbol(), SYMFLAG_LOCAL, and SYMFLAG_PARAMETER.
Referenced by Dyninst::SymtabAPI::Object::ParseSymbolInfo().
| static int variantValue | ( | VARIANT * | v | ) | [static] |
Definition at line 1394 of file Object-nt.C.
Referenced by getEnumType().
| Dyninst::MachRegister WinConvert | ( | Register | reg | ) |
Definition at line 1214 of file Object-nt.C.
Referenced by enumLocalSymbols().
| bool pd_debug_export_symbols = false |
Definition at line 64 of file Object-nt.C.
1.6.1