Add getter for section category name.

This commit is contained in:
Bartosz Taudul
2026-07-14 16:53:25 +02:00
parent ece976e820
commit 42fc8d8d8f
2 changed files with 12 additions and 0 deletions

View File

@@ -9195,4 +9195,15 @@ bool Worker::IsSourceExternalBody( StringIdx filename, uint32_t key, unordered_f
return res;
}
const char* Worker::GetSectionCategoryDescription( uint16_t category ) const
{
auto it = m_data.sectionsDescription.find( category );
assert( it != m_data.sectionsDescription.end() );
if( it->second.Active() ) return GetString( it->second );
static char buf[64];
sprintf( buf, "Category %" PRIu16, category );
return buf;
}
}

View File

@@ -575,6 +575,7 @@ public:
const Vector<short_ptr<FrameImage>>& GetFrameImages() const { return m_data.frameImage; }
const Vector<StringRef>& GetAppInfo() const { return m_data.appInfo; }
const unordered_flat_map<uint16_t, Vector<SectionItem>>& GetSections() const { return m_data.sections; }
const char* GetSectionCategoryDescription( uint16_t category ) const;
const VarArray<CallstackFrameId>& GetCallstack( uint32_t idx ) const { return *m_data.callstackPayload[idx]; }
const CallstackFrameData* GetCallstackFrame( const CallstackFrameId& ptr ) const;