diff --git a/elf.cc b/elf.cc index 7d169e1..6821572 100644 --- a/elf.cc +++ b/elf.cc @@ -532,7 +532,6 @@ Object::findDebugSymbol(const string &name) // auto syms = debugSymbols(); if (!cachedSymbols) { - std::clog << "caching symbols for " << io->filename() << "\n"; cachedSymbols = std::make_unique>(); size_t idx = 0; for (auto sym : syms->array) diff --git a/fs.cc b/fs.cc index 87f78de..7cce2ef 100644 --- a/fs.cc +++ b/fs.cc @@ -32,11 +32,16 @@ std::string linkResolve(std::string name) { char buf[1024]; + std::string orig = name; int rc; for (;;) { rc = readlink(name.c_str(), buf, sizeof buf - 1); - if (rc == -1) - break; + // some files in /proc are links, but report "(deleted)" in the name if + // the original has gone away. Opening such files works, and uses the + // in-core inode, so use that if we can + if (rc == -1) { + return errno == EINVAL ? name : orig; + } buf[rc] = 0; if (buf[0] != '/') { auto lastSlash = name.rfind('/');