diff --git a/llvm/test/tools/dsymutil/ARM/missing-object-warning.test b/llvm/test/tools/dsymutil/ARM/missing-object-warning.test new file mode 100644 index 0000000000000..62b3ecb31888b --- /dev/null +++ b/llvm/test/tools/dsymutil/ARM/missing-object-warning.test @@ -0,0 +1,5 @@ +RUN: dsymutil -oso-prepend-path %p/../Inputs --dump-debug-map %p/../Inputs/private/tmp/missing/foobar.out 2>&1 | FileCheck %s + +CHECK: bar.o unable to open object file +CHECK-NOT: could not find object file symbol for symbol _bar +CHECK-NOT: could not find object file symbol for symbol _main diff --git a/llvm/test/tools/dsymutil/Inputs/private/tmp/missing/foo.o b/llvm/test/tools/dsymutil/Inputs/private/tmp/missing/foo.o new file mode 100644 index 0000000000000..333b39c45b145 Binary files /dev/null and b/llvm/test/tools/dsymutil/Inputs/private/tmp/missing/foo.o differ diff --git a/llvm/test/tools/dsymutil/Inputs/private/tmp/missing/foobar.out b/llvm/test/tools/dsymutil/Inputs/private/tmp/missing/foobar.out new file mode 100755 index 0000000000000..2574c85b99292 Binary files /dev/null and b/llvm/test/tools/dsymutil/Inputs/private/tmp/missing/foobar.out differ diff --git a/llvm/tools/dsymutil/MachODebugMapParser.cpp b/llvm/tools/dsymutil/MachODebugMapParser.cpp index 524a6795c360e..6a9f25681cdd1 100644 --- a/llvm/tools/dsymutil/MachODebugMapParser.cpp +++ b/llvm/tools/dsymutil/MachODebugMapParser.cpp @@ -186,6 +186,8 @@ void MachODebugMapParser::addCommonSymbols() { /// everything up to add symbols to the new one. void MachODebugMapParser::switchToNewDebugMapObject( StringRef Filename, sys::TimePoint Timestamp) { + addCommonSymbols(); + resetParserState(); SmallString<80> Path(PathPrefix); sys::path::append(Path, Filename); @@ -206,9 +208,6 @@ void MachODebugMapParser::switchToNewDebugMapObject( return; } - addCommonSymbols(); - resetParserState(); - CurrentDebugMapObject = &Result->addDebugMapObject(Path, Timestamp, MachO::N_OSO);