-
Notifications
You must be signed in to change notification settings - Fork 14.6k
[dsymutil] Fix spurious warnings in MachODebugMapParser #78794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This addresses #78411 |
@llvm/pr-subscribers-debuginfo Author: Jonas Devlieghere (JDevlieghere) ChangesWhen the MachODebugMapParser encounters an object file that cannot be found on disk, it currently leaves the parser in an incoherent state, resulting in spurious warnings that can in turn slow down dsymutil. rdar://117515153 Full diff: https://github.com/llvm/llvm-project/pull/78794.diff 4 Files Affected:
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 00000000000000..62b3ecb31888b1
--- /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 00000000000000..333b39c45b1452
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 00000000000000..2574c85b992924
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 524a6795c360e9..6a9f25681cdd1c 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<std::chrono::seconds> 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);
|
When the MachODebugMapParser encounters an object file that cannot be found on disk, it currently leaves the parser in an incoherent state, resulting in spurious warnings that can in turn slow down dsymutil. This fixes llvm#78411. rdar://117515153
cf97829
to
f182d5e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the test this SGTM!
LGTM |
When the MachODebugMapParser encounters an object file that cannot be found on disk, it currently leaves the parser in an incoherent state, resulting in spurious warnings that can in turn slow down dsymutil. This fixes llvm#78411. rdar://117515153 (cherry picked from commit 593395f)
When the MachODebugMapParser encounters an object file that cannot be found on disk, it currently leaves the parser in an incoherent state, resulting in spurious warnings that can in turn slow down dsymutil. This fixes llvm#78411. rdar://117515153 (cherry picked from commit 593395f)
[dsymutil] Fix spurious warnings in MachODebugMapParser (llvm#78794)
L308-L309 of |
We want to keep the DMO as long as we're not encountering a new mergeable library. |
When the MachODebugMapParser encounters an object file that cannot be found on disk, it currently leaves the parser in an incoherent state, resulting in spurious warnings that can in turn slow down dsymutil.
rdar://117515153