mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-30 01:04:36 +00:00
Remove debug info retrieval and download separation.
Retrieval of the descriptor has to be performed in a single step. Finding out what is missing and then downloading in bulk is not possible, as libbacktrace caches the returned descriptors.
This commit is contained in:
parent
7e8961d2fc
commit
6b10ed0af7
@ -575,7 +575,6 @@ struct DebugInfo
|
|||||||
};
|
};
|
||||||
|
|
||||||
FastVector<DebugInfo> s_di_known( 16 );
|
FastVector<DebugInfo> s_di_known( 16 );
|
||||||
FastVector<DebugInfo> s_di_pending( 16 );
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __linux
|
#ifdef __linux
|
||||||
@ -713,29 +712,14 @@ int GetDebugInfoDescriptor( const char* buildid_data, size_t buildid_size )
|
|||||||
auto buildid = (uint8_t*)buildid_data;
|
auto buildid = (uint8_t*)buildid_data;
|
||||||
auto it = FindDebugInfo( s_di_known, buildid, buildid_size );
|
auto it = FindDebugInfo( s_di_known, buildid, buildid_size );
|
||||||
if( it ) return it->fd >= 0 ? dup( it->fd ) : -1;
|
if( it ) return it->fd >= 0 ? dup( it->fd ) : -1;
|
||||||
it = FindDebugInfo( s_di_pending, buildid, buildid_size );
|
|
||||||
if( !it )
|
int fd = debuginfod_find_debuginfo( s_debuginfod, buildid, buildid_size, nullptr );
|
||||||
{
|
it = s_di_known.push_next();
|
||||||
it = s_di_pending.push_next();
|
|
||||||
it->buildid_size = buildid_size;
|
it->buildid_size = buildid_size;
|
||||||
it->buildid = (uint8_t*)tracy_malloc( buildid_size );
|
it->buildid = (uint8_t*)tracy_malloc( buildid_size );
|
||||||
memcpy( it->buildid, buildid, buildid_size );
|
memcpy( it->buildid, buildid, buildid_size );
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DownloadDebugInfo()
|
|
||||||
{
|
|
||||||
assert( !s_di_pending.empty() );
|
|
||||||
for( auto& v : s_di_pending )
|
|
||||||
{
|
|
||||||
int fd = debuginfod_find_debuginfo( s_debuginfod, (const unsigned char*)v.buildid, v.buildid_size, nullptr );
|
|
||||||
auto it = s_di_known.push_next();
|
|
||||||
it->buildid = v.buildid;
|
|
||||||
it->buildid_size = v.buildid_size;
|
|
||||||
it->fd = fd >= 0 ? fd : -1;
|
it->fd = fd >= 0 ? fd : -1;
|
||||||
}
|
return it->fd;
|
||||||
s_di_pending.clear();
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -743,8 +727,6 @@ void EndCallstack()
|
|||||||
{
|
{
|
||||||
#ifdef TRACY_DEBUGINFOD
|
#ifdef TRACY_DEBUGINFOD
|
||||||
ClearDebugInfoVector( s_di_known );
|
ClearDebugInfoVector( s_di_known );
|
||||||
ClearDebugInfoVector( s_di_pending );
|
|
||||||
|
|
||||||
debuginfod_end( s_debuginfod );
|
debuginfod_end( s_debuginfod );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user