Change IsFrameExternal() interface to operate on StringIdx, move to Worker.

This commit is contained in:
Bartosz Taudul
2026-05-14 18:53:25 +02:00
parent 4a58c42e2d
commit 744bd21423
11 changed files with 43 additions and 59 deletions

View File

@@ -8934,4 +8934,22 @@ void Worker::CacheSourceFiles()
}
}
static bool IsFrameExternalImpl( const char* filename, const char* image )
{
if( strncmp( filename, "/usr/", 5 ) == 0 || strncmp( filename, "/lib/", 5 ) == 0 || strcmp( filename, "[unknown]" ) == 0 || strcmp( filename, "<kernel>" ) == 0 ) return true;
if( strncmp( filename, "C:\\Program Files", 16 ) == 0 || strncmp( filename, "d:\\a01\\_work\\", 13 ) == 0 ) return true;
while( *filename )
{
if( filename[0] == '/' && filename[1] == '.' && filename[2] != '.' ) return true;
filename++;
}
if( !image ) return false;
return strncmp( image, "/usr/", 5 ) == 0 || strncmp( image, "/lib/", 5 ) == 0 || strncmp( image, "/lib64/", 7 ) == 0 || strcmp( image, "<kernel>" ) == 0;
}
bool Worker::IsFrameExternal( StringIdx filename, StringIdx image )
{
return IsFrameExternalImpl( GetString( filename ), image.Active() ? GetString( image ) : nullptr );
}
}