mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:37:34 +00:00
LibDebug: Add LineProgram::get_directory_and_file(size_t)
This function returns the directory path & filename for a given file index.
This commit is contained in:
parent
0d89f70b66
commit
98a774a68d
2 changed files with 15 additions and 0 deletions
|
@ -290,4 +290,13 @@ void LineProgram::run_program()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LineProgram::DirectoryAndFile LineProgram::get_directory_and_file(size_t file_index) const
|
||||||
|
{
|
||||||
|
VERIFY(file_index < m_source_files.size());
|
||||||
|
auto file_entry = m_source_files[file_index];
|
||||||
|
VERIFY(file_entry.directory_index < m_source_directories.size());
|
||||||
|
auto directory_entry = m_source_directories[file_entry.directory_index];
|
||||||
|
return { directory_entry, file_entry.name };
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,6 +116,12 @@ public:
|
||||||
|
|
||||||
const Vector<LineInfo>& lines() const { return m_lines; }
|
const Vector<LineInfo>& lines() const { return m_lines; }
|
||||||
|
|
||||||
|
struct DirectoryAndFile {
|
||||||
|
FlyString directory;
|
||||||
|
FlyString filename;
|
||||||
|
};
|
||||||
|
DirectoryAndFile get_directory_and_file(size_t file_index) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void parse_unit_header();
|
void parse_unit_header();
|
||||||
void parse_source_directories();
|
void parse_source_directories();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue