diff --git a/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.cpp b/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.cpp index 540e71e95a6..67f941806c3 100644 --- a/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.cpp +++ b/Userland/Libraries/LibDebug/Dwarf/DwarfInfo.cpp @@ -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 diff --git a/Userland/Libraries/LibDebug/Dwarf/LineProgram.cpp b/Userland/Libraries/LibDebug/Dwarf/LineProgram.cpp index 55d339100da..698418d33a1 100644 --- a/Userland/Libraries/LibDebug/Dwarf/LineProgram.cpp +++ b/Userland/Libraries/LibDebug/Dwarf/LineProgram.cpp @@ -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); +} + } diff --git a/Userland/Libraries/LibDebug/Dwarf/LineProgram.h b/Userland/Libraries/LibDebug/Dwarf/LineProgram.h index 089a9098956..a0d7038d251 100644 --- a/Userland/Libraries/LibDebug/Dwarf/LineProgram.h +++ b/Userland/Libraries/LibDebug/Dwarf/LineProgram.h @@ -130,6 +130,8 @@ public: }; Vector const& source_files() const { return m_source_files; } + bool looks_like_embedded_resource() const; + private: void parse_unit_header(); void parse_source_directories();