mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 14:44:34 +00:00
Add EnsureReadable() implementation for Windows.
This commit is contained in:
parent
6d1deb5640
commit
c383e7ae25
@ -271,8 +271,19 @@ static bool EnsureReadable( uintptr_t address )
|
|||||||
MappingInfo* mapping = LookUpMapping(address);
|
MappingInfo* mapping = LookUpMapping(address);
|
||||||
return mapping && EnsureReadable( *mapping );
|
return mapping && EnsureReadable( *mapping );
|
||||||
}
|
}
|
||||||
|
#elif defined WIN32
|
||||||
#endif // defined __ANDROID__
|
static bool EnsureReadable( uintptr_t address )
|
||||||
|
{
|
||||||
|
MEMORY_BASIC_INFORMATION memInfo;
|
||||||
|
VirtualQuery( reinterpret_cast<void*>( address ), &memInfo, sizeof( memInfo ) );
|
||||||
|
return memInfo.Protect != PAGE_NOACCESS;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
static bool EnsureReadable( uintptr_t address )
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef TRACY_DELAYED_INIT
|
#ifndef TRACY_DELAYED_INIT
|
||||||
|
|
||||||
@ -3913,15 +3924,12 @@ void Profiler::HandleSymbolCodeQuery( uint64_t symbol, uint32_t size )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef __ANDROID__
|
|
||||||
// On Android it's common for code to be in mappings that are only executable
|
|
||||||
// but not readable.
|
|
||||||
if( !EnsureReadable( symbol ) )
|
if( !EnsureReadable( symbol ) )
|
||||||
{
|
{
|
||||||
AckSymbolCodeNotAvailable();
|
AckSymbolCodeNotAvailable();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
SendLongString( symbol, (const char*)symbol, size, QueueType::SymbolCode );
|
SendLongString( symbol, (const char*)symbol, size, QueueType::SymbolCode );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user