summaryrefslogtreecommitdiffstats
path: root/llvm/tools/sancov
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2016-06-03 20:25:09 +0000
committerReid Kleckner <rnk@google.com>2016-06-03 20:25:09 +0000
commitf27f3f8491dfc7aa41f6cd8a95763acc677d379c (patch)
treebfcad7e106f02a36e9fb8ae9263614e633a76405 /llvm/tools/sancov
parent9faa5bcf13748459714fabac98f9109ea8616963 (diff)
downloadbcm5719-llvm-f27f3f8491dfc7aa41f6cd8a95763acc677d379c.tar.gz
bcm5719-llvm-f27f3f8491dfc7aa41f6cd8a95763acc677d379c.zip
[Symbolize] Check if the PE file has a PDB and emit an error if we can't load it
Summary: Previously we would try to load PDBs for every PE executable we tried to symbolize. If that failed, we would fall back to DWARF. If there wasn't any DWARF, we'd print mostly useless symbol information using the export table. With this change, we only try to load PDBs for executables that claim to have them. If that fails, we can now print an error rather than falling back silently. This should make it a lot easier to diagnose and fix common symbolization issues, such as not having DIA or not having a PDB. Reviewers: zturner, eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D20982 llvm-svn: 271725
Diffstat (limited to 'llvm/tools/sancov')
-rw-r--r--llvm/tools/sancov/sancov.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/tools/sancov/sancov.cc b/llvm/tools/sancov/sancov.cc
index efeb46a1faa..e4e83b0bbc8 100644
--- a/llvm/tools/sancov/sancov.cc
+++ b/llvm/tools/sancov/sancov.cc
@@ -135,6 +135,12 @@ template <typename T> static void FailIfError(const ErrorOr<T> &E) {
FailIfError(E.getError());
}
+template <typename T> static void FailIfError(Expected<T> &E) {
+ if (E)
+ return;
+ logAllUnhandledErrors(E.takeError(), errs(), "Error: ");
+}
+
static void FailIfNotEmpty(const llvm::Twine &E) {
if (E.str().empty())
return;
OpenPOWER on IntegriCloud