mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibDebug: Factor out the "looks like embedded resource" condition
This commit is contained in:
parent
afc055c088
commit
edd4913573
Notes:
sideshowbarker
2024-07-17 07:20:57 +09:00
Author: https://github.com/timschumi Commit: https://github.com/SerenityOS/serenity/commit/edd4913573 Pull-request: https://github.com/SerenityOS/serenity/pull/16971 Reviewed-by: https://github.com/gmta ✅
3 changed files with 8 additions and 1 deletions
|
@ -65,7 +65,7 @@ void DwarfInfo::populate_compilation_units()
|
|||
// Meaning that for graphical applications, some line info data would be unread, triggering the assertion below.
|
||||
// As a fix, we don't create compilation units for line programs that come from resource files.
|
||||
#if defined(AK_COMPILER_CLANG)
|
||||
if (line_program->source_files().size() == 1 && line_program->source_files()[0].name.view().contains("serenity_icon_"sv)) {
|
||||
if (line_program->looks_like_embedded_resource()) {
|
||||
debug_info_stream.seek(unit_offset);
|
||||
} else
|
||||
#endif
|
||||
|
|
|
@ -306,4 +306,9 @@ LineProgram::DirectoryAndFile LineProgram::get_directory_and_file(size_t file_in
|
|||
return { directory_entry, file_entry.name };
|
||||
}
|
||||
|
||||
bool LineProgram::looks_like_embedded_resource() const
|
||||
{
|
||||
return source_files().size() == 1 && source_files()[0].name.view().contains("serenity_icon_"sv);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -130,6 +130,8 @@ public:
|
|||
};
|
||||
Vector<FileEntry> const& source_files() const { return m_source_files; }
|
||||
|
||||
bool looks_like_embedded_resource() const;
|
||||
|
||||
private:
|
||||
void parse_unit_header();
|
||||
void parse_source_directories();
|
||||
|
|
Loading…
Reference in a new issue