forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 349
🍒 [lldb][MachO] Fix inspection of global variables that start with 'O' #11542
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
Open
Michael137
wants to merge
4
commits into
swift/release/6.2.1
Choose a base branch
from
lldb/macho-objc-metadata-parsing-to-6.2.1
base: swift/release/6.2.1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
🍒 [lldb][MachO] Fix inspection of global variables that start with 'O' #11542
Michael137
wants to merge
4
commits into
swift/release/6.2.1
from
lldb/macho-objc-metadata-parsing-to-6.2.1
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@swift-ci test |
adrian-prantl
approved these changes
Oct 1, 2025
edcd511
to
356a101
Compare
@swift-ci test |
@swift-ci test windows |
Required for llvm#161521 (cherry picked from commit 7ae3eca)
…lvm#161521) On Darwin C-symbols are prefixed with a '_'. The LLDB Macho-O parses handles Objective-C metadata symbols starting with '_OBJC' specially. Previously global symbols starting with a '_O' prefix were lost because of incorrectly scoped if-guards. This patch removes those checks. There is more cleanup that can be done in this file because there's a bunch of duplicated checks for these ObjC symbols. I decided to leave that for an NFC follow-up. Depends on llvm#161520 rdar://158159242 (cherry picked from commit 9f7e7f7)
356a101
to
12fdea4
Compare
Failing with: ``` error: command failed with exit status: 1 executed command: 'c:\buildbot\as-builder-10\lldb-x86-64\build\bin\filecheck.exe' 'C:\buildbot\as-builder-10\lldb-x86-64\llvm-project\lldb\test\Shell\Expr\TestGlobalSymbolObjCConflict.c' .---command stderr------------ | C:\buildbot\as-builder-10\lldb-x86-64\llvm-project\lldb\test\Shell\Expr\TestGlobalSymbolObjCConflict.c:30:11: error: CHECK: expected string not found in input | // CHECK: (lldb) p OglobalVar | ^ | <stdin>:1:1: note: scanning from here | (lldb) command source -s 0 'C:/buildbot/as-builder-10/lldb-x86-64/build/tools/lldb\test\Shell\lit-lldb-init-quiet' | ^ | <stdin>:4:1: note: possible intended match here | (lldb) target create "C:\\buildbot\\as-builder-10\\lldb-x86-64\\build\\tools\\lldb\\test\\Shell\\Expr\\Output\\TestGlobalSymbolObjCConflict.c.tmp.out" | ^ | | Input file: <stdin> | Check file: C:\buildbot\as-builder-10\lldb-x86-64\llvm-project\lldb\test\Shell\Expr\TestGlobalSymbolObjCConflict.c | | -dump-input=help explains the following input dump. | | Input was: | <<<<<< | 1: (lldb) command source -s 0 'C:/buildbot/as-builder-10/lldb-x86-64/build/tools/lldb\test\Shell\lit-lldb-init-quiet' | check:30'0 X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found | 2: Executing commands in 'C:\buildbot\as-builder-10\lldb-x86-64\build\tools\lldb\test\Shell\lit-lldb-init-quiet'. | check:30'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 3: (lldb) command source -C --silent-run true lit-lldb-init | check:30'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 4: (lldb) target create "C:\\buildbot\\as-builder-10\\lldb-x86-64\\build\\tools\\lldb\\test\\Shell\\Expr\\Output\\TestGlobalSymbolObjCConflict.c.tmp.out" | check:30'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | check:30'1 ? possible intended match | 5: Current executable set to 'C:\buildbot\as-builder-10\lldb-x86-64\build\tools\lldb\test\Shell\Expr\Output\TestGlobalSymbolObjCConflict.c.tmp.out' (x86_64). | check:30'0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 6: (lldb) b 27 | check:30'0 ~~~~~~~~~~~~ | >>>>>> `----------------------------- error: command failed with exit status: 1 ``` We probably need to use LLD here or something. But I don't have a Windows machine to test this on. So XFAILing for now. (cherry picked from commit 6382bb5)
…helper function" (llvm#161655) This reverts `5a80fb9177e3c831c9c574400a13d77393397f2a`. The original change got reverted because of failing tests on macOS. The issue was that I changed the scope of setting `type = eSymbolTypeData` during the cleanup. This patch relands the original patch but doesn't change the `else` branch to an `else if` branch. Tested that macOS test-suite passes. (cherry picked from commit 07974fe)
12fdea4
to
b24ddff
Compare
@swift-ci test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On Darwin C-symbols are prefixed with a '_'. The LLDB Macho-O parses
handles Objective-C metadata symbols starting with '_OBJC' specially.
Previously global symbols starting with a '_O' prefix were lost because
of incorrectly scoped if-guards. This patch removes those checks.
There is more cleanup that can be done in this file because there's a
bunch of duplicated checks for these ObjC symbols. I decided to leave
that for an NFC follow-up.
rdar://158159242
(cherry picked from commit 9f7e7f7)