forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 342
[lldb] Fix Swift.Optional formatter behavior when types cannot be res #9909
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
Merged
adrian-prantl
merged 2 commits into
swiftlang:swift/release/6.1
from
adrian-prantl:143358292
Jan 30, 2025
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
5 changes: 5 additions & 0 deletions
5
lldb/test/API/lang/swift/optional_error_handling/Library.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
public struct WithOpaqueType { | ||
public init() {} | ||
let opaqueSome : FromC? = FromC(i: 23) | ||
let opaqueNone : FromC? = nil | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
SWIFT_SOURCES := main.swift | ||
SWIFTFLAGS_EXTRAS = -I. | ||
LD_EXTRAS = -L. -lLibrary | ||
|
||
|
||
all: Library $(EXE) | ||
|
||
include Makefile.rules | ||
|
||
.PHONY: Library | ||
Library: | ||
$(MAKE) MAKE_DSYM=NO CC=$(CC) SWIFTC=$(SWIFTC) \ | ||
ARCH=$(ARCH) DSYMUTIL=$(DSYMUTIL) \ | ||
VPATH=$(SRCDIR) -I $(SRCDIR) SRCDIR=$(SRCDIR) \ | ||
-f $(THIS_FILE_DIR)/Makefile.rules \ | ||
DYLIB_SWIFT_SOURCES=Library.swift \ | ||
SWIFT_BRIDGING_HEADER=bridging.h \ | ||
SWIFT_PRECOMPILE_BRIDGING_HEADER=NO \ | ||
DYLIB_NAME=Library \ | ||
DYLIB_ONLY=YES \ | ||
DEBUG_INFO_FLAG= \ | ||
all |
20 changes: 20 additions & 0 deletions
20
lldb/test/API/lang/swift/optional_error_handling/TestSwiftOptionalErrorHandling.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import lldb | ||
from lldbsuite.test.lldbtest import * | ||
from lldbsuite.test.decorators import * | ||
import lldbsuite.test.lldbutil as lldbutil | ||
|
||
class TestSwiftOptionalErrorHandling(TestBase): | ||
NO_DEBUG_INFO_TESTCASE = True | ||
|
||
@swiftTest | ||
def test(self): | ||
"""Test that errors are surfaced""" | ||
self.build() | ||
target, process, thread, bkpt = lldbutil.run_to_source_breakpoint( | ||
self, "break here", lldb.SBFileSpec("main.swift"), | ||
extra_images=['Library']) | ||
self.expect('settings set symbols.use-swift-clangimporter false') | ||
self.expect('frame variable x', substrs=[ | ||
'opaqueSome', 'missing debug info for Clang type', 'FromC', | ||
'opaqueNone', 'nil', | ||
]) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
struct FromC { | ||
int i; | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import Library | ||
func main() { | ||
let x = WithOpaqueType() | ||
print(x) // break here | ||
} | ||
main() |
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.
Uh oh!
There was an error while loading. Please reload this page.