Commit c2e0dbf3 authored by ussrhero's avatar ussrhero
Browse files

Merge branch 'revert_cache' into 'dev-1.0'

Revert TypeInfo cache

See merge request !34
parents eb852513 1b294a84
...@@ -171,10 +171,7 @@ enum CallingConventionType ...@@ -171,10 +171,7 @@ enum CallingConventionType
class Symbol { class Symbol {
public: public:
typedef unsigned long SymIndexId;
static const SymIndexId InvalidId = -1;
virtual SymIndexId getSymIndexId() { return InvalidId; }
virtual SymbolPtrList findChildren( unsigned long symTag, const std::wstring &name = L"", bool caseSensitive = false ) = 0; virtual SymbolPtrList findChildren( unsigned long symTag, const std::wstring &name = L"", bool caseSensitive = false ) = 0;
virtual SymbolPtrList findChildrenByRVA(unsigned long symTag, unsigned long rva) = 0; virtual SymbolPtrList findChildrenByRVA(unsigned long symTag, unsigned long rva) = 0;
virtual unsigned long getBaseType() = 0; virtual unsigned long getBaseType() = 0;
......
...@@ -154,6 +154,7 @@ protected: ...@@ -154,6 +154,7 @@ protected:
static bool isBaseType( const std::wstring &typeName ); static bool isBaseType( const std::wstring &typeName );
static bool isComplexType( const std::wstring &typeName ); static bool isComplexType( const std::wstring &typeName );
static TypeInfoPtr getTypeInfoFromCache(const std::wstring &typeName );
static TypeInfoPtr getBaseTypeInfo( const std::wstring &typeName, size_t ptrSize = 0); static TypeInfoPtr getBaseTypeInfo( const std::wstring &typeName, size_t ptrSize = 0);
static TypeInfoPtr getBaseTypeInfo( const SymbolPtr &symbolScope ); static TypeInfoPtr getBaseTypeInfo( const SymbolPtr &symbolScope );
......
...@@ -200,18 +200,6 @@ SymbolPtr DiaSymbol::fromGlobalScope( IDiaSymbol *_symbol, const std::wstring& _ ...@@ -200,18 +200,6 @@ SymbolPtr DiaSymbol::fromGlobalScope( IDiaSymbol *_symbol, const std::wstring& _
////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////
Symbol::SymIndexId DiaSymbol::getSymIndexId()
{
SymIndexId id;
HRESULT hres = m_symbol->get_symIndexId(&id);
if(S_OK == hres)
return id;
return Symbol::getSymIndexId();
}
//////////////////////////////////////////////////////////////////////////////////
SymbolPtrList DiaSymbol::findChildren( SymbolPtrList DiaSymbol::findChildren(
ULONG symTag, ULONG symTag,
const std::wstring &name, const std::wstring &name,
......
...@@ -59,8 +59,6 @@ public: ...@@ -59,8 +59,6 @@ public:
static SymbolPtr fromGlobalScope( IDiaSymbol *_symbol, const std::wstring &_scope ); static SymbolPtr fromGlobalScope( IDiaSymbol *_symbol, const std::wstring &_scope );
SymIndexId getSymIndexId() override;
SymbolPtr getChildByName(const std::wstring &_name ) override; SymbolPtr getChildByName(const std::wstring &_name ) override;
ULONG getRva() override; ULONG getRva() override;
......
...@@ -701,10 +701,6 @@ ScopePtr ModuleImp::getScope() ...@@ -701,10 +701,6 @@ ScopePtr ModuleImp::getScope()
MEMOFFSET_64 findModuleBySymbol( const std::wstring &symbolName ) MEMOFFSET_64 findModuleBySymbol( const std::wstring &symbolName )
{ {
MEMOFFSET_64 module_base = ProcessMonitor::getModuleBaseBySymbol(symbolName);
if (module_base)
return module_base;
std::vector<MEMOFFSET_64> moduleList = getModuleBasesList(); std::vector<MEMOFFSET_64> moduleList = getModuleBasesList();
std::vector<MEMOFFSET_64>::const_iterator it; std::vector<MEMOFFSET_64>::const_iterator it;
...@@ -715,8 +711,7 @@ MEMOFFSET_64 findModuleBySymbol( const std::wstring &symbolName ) ...@@ -715,8 +711,7 @@ MEMOFFSET_64 findModuleBySymbol( const std::wstring &symbolName )
try { try {
SymbolPtr typeInfo = module->getSymbolByName( symbolName ); SymbolPtr typeInfo = module->getSymbolByName( symbolName );
module_base = *it; return *it;
break;
} }
catch( SymbolException& ) catch( SymbolException& )
{} {}
...@@ -724,19 +719,12 @@ MEMOFFSET_64 findModuleBySymbol( const std::wstring &symbolName ) ...@@ -724,19 +719,12 @@ MEMOFFSET_64 findModuleBySymbol( const std::wstring &symbolName )
try { try {
TypeInfoPtr typeInfo = module->getTypeByName( symbolName ); TypeInfoPtr typeInfo = module->getTypeByName( symbolName );
module_base = *it; return *it;
break;
} }
catch( SymbolException& ) catch( SymbolException& )
{} {}
} }
if (module_base)
{
ProcessMonitor::insertModuleBaseBySymbol(symbolName, module_base);
return module_base;
}
std::wstringstream sstr; std::wstringstream sstr;
sstr << L"failed to find module for symbol: " << symbolName; sstr << L"failed to find module for symbol: " << symbolName;
throw SymbolException( sstr.str() ); throw SymbolException( sstr.str() );
......
...@@ -25,11 +25,8 @@ public: ...@@ -25,11 +25,8 @@ public:
void insertModule( ModulePtr& module); void insertModule( ModulePtr& module);
void removeModule(MEMOFFSET_64 offset ); void removeModule(MEMOFFSET_64 offset );
MEMOFFSET_64 getModuleBaseBySymbol(const std::wstring& sym); TypeInfoPtr getTypeInfo(const std::wstring& name);
void insertModuleBaseBySymbol(const std::wstring& sym, MEMOFFSET_64 module_base); void insertTypeInfo(const TypeInfoPtr& typeInfo);
TypeInfoPtr getTypeInfo(const SymbolPtr& sym);
void insertTypeInfo(const SymbolPtr& sym, const TypeInfoPtr& typeInfo);
void insertBreakpoint(const BreakpointPtr& breakpoint); void insertBreakpoint(const BreakpointPtr& breakpoint);
void removeBreakpoint(const BreakpointPtr& breakpoint); void removeBreakpoint(const BreakpointPtr& breakpoint);
...@@ -44,14 +41,10 @@ private: ...@@ -44,14 +41,10 @@ private:
ModuleMap m_moduleMap; ModuleMap m_moduleMap;
boost::recursive_mutex m_moduleLock; boost::recursive_mutex m_moduleLock;
typedef std::map<std::wstring, MEMOFFSET_64> SymbolMap; typedef std::map<std::wstring, TypeInfoPtr> TypeInfoMap;
SymbolMap m_symbolMap; TypeInfoMap m_typeInfoMap;
boost::recursive_mutex m_symbolLock; boost::recursive_mutex m_typeInfoLock;
typedef std::map<std::pair<std::wstring, Symbol::SymIndexId>, TypeInfoPtr> TypeInfoMap;
TypeInfoMap m_typeInfoMap;
boost::recursive_mutex m_typeInfoLock;
typedef std::map<BREAKPOINT_ID, BreakpointPtr> BreakpointIdMap; typedef std::map<BREAKPOINT_ID, BreakpointPtr> BreakpointIdMap;
BreakpointIdMap m_breakpointMap; BreakpointIdMap m_breakpointMap;
boost::recursive_mutex m_breakpointLock; boost::recursive_mutex m_breakpointLock;
...@@ -96,8 +89,8 @@ public: ...@@ -96,8 +89,8 @@ public:
ModulePtr getModule( MEMOFFSET_64 offset, PROCESS_DEBUG_ID id ); ModulePtr getModule( MEMOFFSET_64 offset, PROCESS_DEBUG_ID id );
void insertModule( ModulePtr& module, PROCESS_DEBUG_ID id ); void insertModule( ModulePtr& module, PROCESS_DEBUG_ID id );
MEMOFFSET_64 getModuleBaseBySymbol(const std::wstring& sym, PROCESS_DEBUG_ID id); TypeInfoPtr getTypeInfo(const std::wstring& name, PROCESS_DEBUG_ID id = -1);
void insertModuleBaseBySymbol(const std::wstring& sym, MEMOFFSET_64 module_base, PROCESS_DEBUG_ID id); void insertTypeInfo(const TypeInfoPtr& typeInfo, PROCESS_DEBUG_ID id = -1);
void registerEventsCallback(DebugEventsCallback *callback); void registerEventsCallback(DebugEventsCallback *callback);
void removeEventsCallback(DebugEventsCallback *callback); void removeEventsCallback(DebugEventsCallback *callback);
...@@ -105,9 +98,6 @@ public: ...@@ -105,9 +98,6 @@ public:
void registerBreakpoint( const BreakpointPtr& breakpoint, PROCESS_DEBUG_ID id = -1 ); void registerBreakpoint( const BreakpointPtr& breakpoint, PROCESS_DEBUG_ID id = -1 );
void removeBreakpoint( const BreakpointPtr& breakpoint, PROCESS_DEBUG_ID id = -1 ); void removeBreakpoint( const BreakpointPtr& breakpoint, PROCESS_DEBUG_ID id = -1 );
TypeInfoPtr getTypeInfo(const SymbolPtr& sym, PROCESS_DEBUG_ID id = -1);
void insertTypeInfo(const SymbolPtr& sym, const TypeInfoPtr& typeInfo, PROCESS_DEBUG_ID id = -1);
private: private:
ProcessInfoPtr getProcess( PROCESS_DEBUG_ID id ); ProcessInfoPtr getProcess( PROCESS_DEBUG_ID id );
...@@ -204,26 +194,6 @@ void ProcessMonitor::removeBreakpoint( const BreakpointPtr& breakpoint, PROCESS_ ...@@ -204,26 +194,6 @@ void ProcessMonitor::removeBreakpoint( const BreakpointPtr& breakpoint, PROCESS_
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
TypeInfoPtr ProcessMonitor::getTypeInfo(const SymbolPtr& sym, PROCESS_DEBUG_ID id)
{
if (id == -1)
id = getCurrentProcessId();
return g_procmon->getTypeInfo(sym, id);
}
/////////////////////////////////////////////////////////////////////////////
void ProcessMonitor::insertTypeInfo(const SymbolPtr& sym, const TypeInfoPtr& typeInfo, PROCESS_DEBUG_ID id)
{
if (id == -1)
id = getCurrentProcessId();
return g_procmon->insertTypeInfo(sym, typeInfo, id);
}
/////////////////////////////////////////////////////////////////////////////
DebugCallbackResult ProcessMonitor::processStart(PROCESS_DEBUG_ID id) DebugCallbackResult ProcessMonitor::processStart(PROCESS_DEBUG_ID id)
{ {
return g_procmon->processStart(id); return g_procmon->processStart(id);
...@@ -377,22 +347,22 @@ void ProcessMonitor::insertModule( ModulePtr& module, PROCESS_DEBUG_ID id ) ...@@ -377,22 +347,22 @@ void ProcessMonitor::insertModule( ModulePtr& module, PROCESS_DEBUG_ID id )
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
MEMOFFSET_64 ProcessMonitor::getModuleBaseBySymbol(const std::wstring& sym, PROCESS_DEBUG_ID id) TypeInfoPtr ProcessMonitor::getTypeInfo(const std::wstring& name, PROCESS_DEBUG_ID id)
{ {
if (id == -1) if (id == -1)
id = getCurrentProcessId(); id = getCurrentProcessId();
return g_procmon->getModuleBaseBySymbol(sym, id); return g_procmon->getTypeInfo(name, id);
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
void ProcessMonitor::insertModuleBaseBySymbol(const std::wstring& sym, MEMOFFSET_64 module_base, PROCESS_DEBUG_ID id) void ProcessMonitor::insertTypeInfo(const TypeInfoPtr& typeInfo, PROCESS_DEBUG_ID id)
{ {
if (id == -1) if (id == -1)
id = getCurrentProcessId(); id = getCurrentProcessId();
return g_procmon->insertModuleBaseBySymbol(sym, module_base, id); return g_procmon->insertTypeInfo(typeInfo, id);
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
...@@ -746,42 +716,22 @@ void ProcessMonitorImpl::insertModule( ModulePtr& module, PROCESS_DEBUG_ID id ) ...@@ -746,42 +716,22 @@ void ProcessMonitorImpl::insertModule( ModulePtr& module, PROCESS_DEBUG_ID id )
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
MEMOFFSET_64 ProcessMonitorImpl::getModuleBaseBySymbol(const std::wstring& sym, PROCESS_DEBUG_ID id) TypeInfoPtr ProcessMonitorImpl::getTypeInfo(const std::wstring& name, PROCESS_DEBUG_ID id)
{
ProcessInfoPtr processInfo = getProcess(id);
if (processInfo)
return processInfo->getModuleBaseBySymbol(sym);
return 0;
}
///////////////////////////////////////////////////////////////////////////////
void ProcessMonitorImpl::insertModuleBaseBySymbol(const std::wstring& sym, MEMOFFSET_64 module_base, PROCESS_DEBUG_ID id)
{
ProcessInfoPtr processInfo = getProcess(id);
if (processInfo)
return processInfo->insertModuleBaseBySymbol(sym, module_base);
}
///////////////////////////////////////////////////////////////////////////////
TypeInfoPtr ProcessMonitorImpl::getTypeInfo(const SymbolPtr& sym, PROCESS_DEBUG_ID id)
{ {
ProcessInfoPtr processInfo = getProcess(id); ProcessInfoPtr processInfo = getProcess(id);
if (processInfo) if ( processInfo )
return processInfo->getTypeInfo(sym); return processInfo->getTypeInfo(name);
return TypeInfoPtr(); return TypeInfoPtr();
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
void ProcessMonitorImpl::insertTypeInfo(const SymbolPtr& sym, const TypeInfoPtr& typeInfo, PROCESS_DEBUG_ID id) void ProcessMonitorImpl::insertTypeInfo(const TypeInfoPtr& typeInfo, PROCESS_DEBUG_ID id)
{ {
ProcessInfoPtr processInfo = getProcess(id); ProcessInfoPtr processInfo = getProcess(id);
if (processInfo) if (processInfo)
return processInfo->insertTypeInfo(sym, typeInfo); return processInfo->insertTypeInfo(typeInfo);
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
...@@ -876,78 +826,19 @@ void ProcessInfo::insertModule( ModulePtr& module) ...@@ -876,78 +826,19 @@ void ProcessInfo::insertModule( ModulePtr& module)
void ProcessInfo::removeModule(MEMOFFSET_64 offset ) void ProcessInfo::removeModule(MEMOFFSET_64 offset )
{ {
ModulePtr module; boost::recursive_mutex::scoped_lock l(m_moduleLock);
{ m_moduleMap.erase(offset);
boost::recursive_mutex::scoped_lock l(m_moduleLock);
ModuleMap::iterator it = m_moduleMap.find(offset);
if(it != m_moduleMap.end())
{
module = it->second;
m_moduleMap.erase(it);
}
}
// clear symbol cache for this module
{
boost::recursive_mutex::scoped_lock l(m_symbolLock);
SymbolMap::iterator it = m_symbolMap.begin();
while (it != m_symbolMap.end())
{
if(it->second == offset)
it = m_symbolMap.erase(it);
else
++it;
}
}
// clear TypeInfo cache for this module
if(module)
{
std::wstring scope = module->getName();
boost::recursive_mutex::scoped_lock l(m_typeInfoLock);
TypeInfoMap::iterator it = m_typeInfoMap.begin();
while (it != m_typeInfoMap.end())
{
if (it->first.first == scope)
it = m_typeInfoMap.erase(it);
else
++it;
}
}
}
///////////////////////////////////////////////////////////////////////////////
MEMOFFSET_64 ProcessInfo::getModuleBaseBySymbol(const std::wstring& sym)
{
boost::recursive_mutex::scoped_lock l(m_symbolLock);
SymbolMap::iterator it = m_symbolMap.find(sym);
if(it != m_symbolMap.end())
return it->second;
return 0;
}
///////////////////////////////////////////////////////////////////////////////
void ProcessInfo::insertModuleBaseBySymbol(const std::wstring& sym, MEMOFFSET_64 module_base)
{
boost::recursive_mutex::scoped_lock l(m_symbolLock);
m_symbolMap[sym] = module_base;
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
TypeInfoPtr ProcessInfo::getTypeInfo(const SymbolPtr& sym) TypeInfoPtr ProcessInfo::getTypeInfo(const std::wstring& name)
{ {
TypeInfoMap::key_type key{ sym->getScopeName(), sym->getSymIndexId() };
boost::recursive_mutex::scoped_lock l(m_typeInfoLock); boost::recursive_mutex::scoped_lock l(m_typeInfoLock);
TypeInfoMap::iterator it = m_typeInfoMap.find(key);
if(it != m_typeInfoMap.end()) TypeInfoMap::iterator it = m_typeInfoMap.find(name);
if (it != m_typeInfoMap.end())
return it->second; return it->second;
return TypeInfoPtr(); return TypeInfoPtr();
...@@ -955,15 +846,11 @@ TypeInfoPtr ProcessInfo::getTypeInfo(const SymbolPtr& sym) ...@@ -955,15 +846,11 @@ TypeInfoPtr ProcessInfo::getTypeInfo(const SymbolPtr& sym)
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
void ProcessInfo::insertTypeInfo(const SymbolPtr& sym, const TypeInfoPtr& typeInfo) void ProcessInfo::insertTypeInfo(const TypeInfoPtr& typeInfo)
{ {
TypeInfoMap::key_type key{ sym->getScopeName(), sym->getSymIndexId() }; boost::recursive_mutex::scoped_lock l(m_typeInfoLock);
if (key.second != Symbol::InvalidId) m_typeInfoMap.insert(std::make_pair(typeInfo->getName(), typeInfo));
{
boost::recursive_mutex::scoped_lock l(m_typeInfoLock);
m_typeInfoMap[key] = typeInfo;
}
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
......
...@@ -48,9 +48,6 @@ public: // module manipulation ...@@ -48,9 +48,6 @@ public: // module manipulation
static ModulePtr getModule( MEMOFFSET_64 offset, PROCESS_DEBUG_ID id = -1 ); static ModulePtr getModule( MEMOFFSET_64 offset, PROCESS_DEBUG_ID id = -1 );
static void insertModule( ModulePtr& module, PROCESS_DEBUG_ID id = -1 ); static void insertModule( ModulePtr& module, PROCESS_DEBUG_ID id = -1 );
static MEMOFFSET_64 getModuleBaseBySymbol(const std::wstring& sym, PROCESS_DEBUG_ID id = -1);
static void insertModuleBaseBySymbol(const std::wstring& sym, MEMOFFSET_64 module_base, PROCESS_DEBUG_ID id = -1);
public: //breakpoint callbacks public: //breakpoint callbacks
static void registerBreakpoint( const BreakpointPtr& breakpoint, PROCESS_DEBUG_ID id = -1 ); static void registerBreakpoint( const BreakpointPtr& breakpoint, PROCESS_DEBUG_ID id = -1 );
...@@ -60,9 +57,10 @@ public: //callbacks ...@@ -60,9 +57,10 @@ public: //callbacks
static void registerEventsCallback(DebugEventsCallback *callback); static void registerEventsCallback(DebugEventsCallback *callback);
static void removeEventsCallback(DebugEventsCallback *callback); static void removeEventsCallback(DebugEventsCallback *callback);
public: // TypeInfo cache public: //
static TypeInfoPtr getTypeInfo(const SymbolPtr& sym, PROCESS_DEBUG_ID id = -1);
static void insertTypeInfo(const SymbolPtr& sym, const TypeInfoPtr& typeInfo, PROCESS_DEBUG_ID id = -1); static TypeInfoPtr getTypeInfo(const std::wstring& name, PROCESS_DEBUG_ID id = -1);
static void insertTypeInfo( const TypeInfoPtr& typeInfo, PROCESS_DEBUG_ID id = -1);
}; };
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
......
...@@ -286,18 +286,12 @@ TypeInfoPtr loadType( const std::wstring &typeName ) ...@@ -286,18 +286,12 @@ TypeInfoPtr loadType( const std::wstring &typeName )
splitSymName( typeName, moduleName, symName ); splitSymName( typeName, moduleName, symName );
ModulePtr module;
if ( moduleName.empty() ) if ( moduleName.empty() )
{ {
MEMOFFSET_64 moduleOffset = findModuleBySymbol(symName); return TypeInfo::getTypeInfoFromCache(symName);
module = loadModule(moduleOffset);
}
else
{
module = loadModule(moduleName);
} }
ModulePtr module = loadModule(moduleName);
SymbolPtr symbolScope = module->getSymbolScope(); SymbolPtr symbolScope = module->getSymbolScope();
...@@ -334,9 +328,7 @@ TypeInfoPtr loadType( const SymbolPtr &symbolScope, const std::wstring &symbolNa ...@@ -334,9 +328,7 @@ TypeInfoPtr loadType( const SymbolPtr &symbolScope, const std::wstring &symbolNa
TypeInfoPtr loadType( const SymbolPtr &symbol ) TypeInfoPtr loadType( const SymbolPtr &symbol )
{ {
unsigned long symTag = symbol->getSymTag(); unsigned long symTag = symbol->getSymTag();
TypeInfoPtr ptr = ProcessMonitor::getTypeInfo(symbol); TypeInfoPtr ptr;
if (ptr)
return ptr;
switch( symTag ) switch( symTag )
{ {
...@@ -353,32 +345,27 @@ TypeInfoPtr loadType( const SymbolPtr &symbol ) ...@@ -353,32 +345,27 @@ TypeInfoPtr loadType( const SymbolPtr &symbol )
NumVariant constVal; NumVariant constVal;
symbol->getValue( constVal ); symbol->getValue( constVal );
ptr = TypeInfo::getBaseTypeInfo(symbol->getType()); ptr = loadType( symbol->getType() );
dynamic_cast<TypeInfoImp*>( ptr.get() )->setConstant( constVal ); dynamic_cast<TypeInfoImp*>( ptr.get() )->setConstant( constVal );
break; break;
} }
ptr = loadType(symbol->getType()); return loadType( symbol->getType() );
break;
case SymTagBaseType: case SymTagBaseType:
ptr = TypeInfo::getBaseTypeInfo(symbol); return TypeInfo::getBaseTypeInfo( symbol );
break;
case SymTagUDT: case SymTagUDT:
case SymTagBaseClass: case SymTagBaseClass:
ptr = TypeInfoPtr(new TypeInfoUdt(symbol)); return TypeInfoPtr( new TypeInfoUdt( symbol ) );
break;
case SymTagArrayType: case SymTagArrayType:
ptr = TypeInfoPtr(new TypeInfoSymbolArray(symbol)); return TypeInfoPtr( new TypeInfoSymbolArray( symbol ) );
break;
case SymTagPointerType: case SymTagPointerType:
ptr = TypeInfoPtr(new TypeInfoSymbolPointer(symbol)); return TypeInfoPtr( new TypeInfoSymbolPointer( symbol ) );
break;
case SymTagVTable: case SymTagVTable:
ptr = TypeInfoPtr( new TypeInfoSymbolPointer( symbol->getType() ) ); ptr = TypeInfoPtr( new TypeInfoSymbolPointer( symbol->getType() ) );
...@@ -419,7 +406,6 @@ TypeInfoPtr loadType( const SymbolPtr &symbol ) ...@@ -419,7 +406,6 @@ TypeInfoPtr loadType( const SymbolPtr &symbol )
//if ( ptr ) //if ( ptr )
// ptr->m_ptrSize = getTypePointerSize(typeSym); // ptr->m_ptrSize = getTypePointerSize(typeSym);
ProcessMonitor::insertTypeInfo(symbol, ptr);
return ptr; return ptr;
} }
...@@ -914,6 +900,23 @@ TypeInfoPtr TypeInfo::getRecursiveComplexType( const std::wstring &typeName, Typ ...@@ -914,6 +900,23 @@ TypeInfoPtr TypeInfo::getRecursiveComplexType( const std::wstring &typeName, Typ
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
TypeInfoPtr TypeInfo::getTypeInfoFromCache(const std::wstring &typeName)
{
TypeInfoPtr cachedType = ProcessMonitor::getTypeInfo(typeName);
if (cachedType)
return cachedType;
MEMOFFSET_64 moduleOffset = findModuleBySymbol(typeName);
TypeInfoPtr typeInfo = loadModule(moduleOffset)->getTypeByName(typeName);;
Proce