Skip to content

[lldb] Don't warn that libobjc was read from memory in corefile #127138

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

jasonmolenda
Copy link
Collaborator

AppleObjCRuntimeV2 prints a warning when we read libobjc.A.dylib from memory, as a canary to detect that we are reading system binaries out of memory (which is slow, and we try hard to avoid). But with a corefile, reading out of "memory" is fine, and may be the only way we can find the correct binary.

rdar://144322688

AppleObjCRuntimeV2 prints a warning when we read libobjc.A.dylib
from memory, as a canary to detect that we are reading system
binaries out of memory (which is slow, and we try hard to avoid).
But with a corefile, reading out of "memory" is fine, and may be
the only way we can find the correct binary.

rdar://144322688
@llvmbot
Copy link
Member

llvmbot commented Feb 13, 2025

@llvm/pr-subscribers-lldb

Author: Jason Molenda (jasonmolenda)

Changes

AppleObjCRuntimeV2 prints a warning when we read libobjc.A.dylib from memory, as a canary to detect that we are reading system binaries out of memory (which is slow, and we try hard to avoid). But with a corefile, reading out of "memory" is fine, and may be the only way we can find the correct binary.

rdar://144322688


Full diff: https://github.com/llvm/llvm-project/pull/127138.diff

1 Files Affected:

  • (modified) lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp (+3)
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
index a57099f3df454..ff17028e6662a 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -2666,6 +2666,9 @@ void AppleObjCRuntimeV2::WarnIfNoExpandedSharedCache() {
   if (!object_file->IsInMemory())
     return;
 
+  if (!GetProcess()->IsLiveDebugSession())
+    return;
+
   Target &target = GetProcess()->GetTarget();
   Debugger &debugger = target.GetDebugger();
 

Copy link
Member

@JDevlieghere JDevlieghere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. LGTM.

@jasonmolenda jasonmolenda merged commit 3c2ba68 into llvm:main Feb 14, 2025
7 of 8 checks passed
@jasonmolenda jasonmolenda deleted the dont-warn-on-libobjc-read-from-corefile-memory branch February 14, 2025 00:01
joaosaffran pushed a commit to joaosaffran/llvm-project that referenced this pull request Feb 14, 2025
…#127138)

AppleObjCRuntimeV2 prints a warning when we read libobjc.A.dylib from
memory, as a canary to detect that we are reading system binaries out of
memory (which is slow, and we try hard to avoid). But with a corefile,
reading out of "memory" is fine, and may be the only way we can find the
correct binary.

rdar://144322688
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Feb 24, 2025
…#127138)

AppleObjCRuntimeV2 prints a warning when we read libobjc.A.dylib from
memory, as a canary to detect that we are reading system binaries out of
memory (which is slow, and we try hard to avoid). But with a corefile,
reading out of "memory" is fine, and may be the only way we can find the
correct binary.

rdar://144322688
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants