diff --git a/src/pystack/_pystack/elf_common.cpp b/src/pystack/_pystack/elf_common.cpp index 972624e..96e43f2 100644 --- a/src/pystack/_pystack/elf_common.cpp +++ b/src/pystack/_pystack/elf_common.cpp @@ -401,7 +401,7 @@ getSectionInfo(const std::string& filename, const std::string& section_name, Sec LOG(DEBUG) << "Trying to locate .PyRuntime data offset from program headers"; file_unique_ptr file(fopen(filename.c_str(), "r"), fclose); if (!file || fileno(file.get()) == -1) { - LOG(ERROR) << "Cannot open ELF file " << filename; + LOG(ERROR) << "Cannot open ELF file " << filename << " (" << std::strerror(errno) << ")"; return false; } const int fd = fileno(file.get()); @@ -559,7 +559,7 @@ getBuildId(const std::string& filename) LOG(DEBUG) << "Trying to locate .PyRuntime data offset from program headers"; file_unique_ptr file(fopen(filename.c_str(), "r"), fclose); if (!file || fileno(file.get()) == -1) { - LOG(ERROR) << "Cannot open ELF file " << filename; + LOG(ERROR) << "Cannot open ELF file " << filename << " (" << std::strerror(errno) << ")"; return ""; } const int fd = fileno(file.get());