| 152 | } |
| 153 | |
| 154 | BOOLEAN Symbols::LoadSymbolsForModule( CString ModulePath, ULONG_PTR ModuleBaseAddress, ULONG SizeOfModule ) |
| 155 | { |
| 156 | int idx = -1; |
| 157 | CString ModuleName; |
| 158 | const TCHAR* szSearchPath = NULL; |
| 159 | SymbolReader* reader = NULL; |
| 160 | BOOLEAN bSucc = FALSE; |
| 161 | |
| 162 | idx = ModulePath.ReverseFind( '/' ); |
| 163 | if (idx == -1) |
| 164 | idx = ModulePath.ReverseFind( '\\' ); |
| 165 | ModuleName = ModulePath.Mid( ++idx ); |
| 166 | |
| 167 | if (!m_strSearchPath.IsEmpty( )) |
| 168 | szSearchPath = m_strSearchPath.GetString( ); |
| 169 | |
| 170 | reader = new SymbolReader( ); |
| 171 | |
| 172 | //ntdll::RtlEnterCriticalSection( &m_CriticalSection ); |
| 173 | |
| 174 | bSucc = reader->LoadFile( ModuleName, ModulePath, ModuleBaseAddress, SizeOfModule, szSearchPath ); |
| 175 | |
| 176 | //ntdll::RtlLeaveCriticalSection( &m_CriticalSection ); |
| 177 | |
| 178 | if (bSucc) |
| 179 | { |
| 180 | PrintOut( _T( "[Symbols::LoadSymbolsForModule] Symbols for module %s loaded" ), ModuleName.GetString( ) ); |
| 181 | m_SymbolAddresses.insert( std::make_pair( ModuleBaseAddress, reader ) ); |
| 182 | return TRUE; |
| 183 | } |
| 184 | |
| 185 | delete reader; |
| 186 | |
| 187 | return FALSE; |
| 188 | } |
| 189 | |
| 190 | BOOLEAN Symbols::LoadSymbolsForPdb( CString PdbPath ) |
| 191 | { |
no test coverage detected