Do not load debug file when filepath is empty
MODIFY
src/CMakeLists.txt
src/CMakeLists.txt
@@ -44,7 +44,7 @@ endfunction()
# Error flags on everything but MSVC
if(NOT MSVC)
- set(CMAKE_CXX_FLAGS "-Wextra -Wall \
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -Wall \
-Werror=switch -Werror=return-type \
-Werror=unreachable-code")
elseif(MINGW)

MODIFY
src/edittab.cpp
src/edittab.cpp
@@ -457,13 +457,13 @@ bool EditTab::loadElfFile(Program& program, QFile& file) {
program.sourceMapping[line.address].insert(line.line - 1);
}
}
-
- // Finally, we need to generate a hash of the source file that we've loaded source mappings from, so the editor
- // knows what editor contents applies to this program.
+ if (!editorSrcFile.isEmpty()) {
+ // Finally, we need to generate a hash of the source file that we've loaded source mappings from, so the
+ // editor knows what editor contents applies to this program.
QFile srcFile(editorSrcFile);
- if (srcFile.open(QFile::ReadOnly)) {
+ if (srcFile.open(QFile::ReadOnly))
program.sourceHash = Program::calculateHash(srcFile.readAll());
- } else {
+ else
throw ::dwarf::format_error("Could not find source file " + editorSrcFile.toStdString());
}
} catch (::dwarf::format_error& e) {

Do not load debug file when filepath is empty