-
Notifications
You must be signed in to change notification settings - Fork 340
[lldb] Avoid returning a false positive error when reaching an ObjC b… #10499
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
SWIFT_SOURCES := main.swift | ||
|
||
include Makefile.rules |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import lldb | ||
from lldbsuite.test.lldbtest import * | ||
from lldbsuite.test.decorators import * | ||
import lldbsuite.test.lldbutil as lldbutil | ||
|
||
class TestSwiftObjCBaseClassMemberLookup(TestBase): | ||
NO_DEBUG_INFO_TESTCASE = True | ||
@skipUnlessDarwin | ||
@swiftTest | ||
def test(self): | ||
"""Test accessing a static member from a member function""" | ||
self.build() | ||
lldbutil.run_to_source_breakpoint( | ||
self, 'break here', lldb.SBFileSpec('main.swift') | ||
) | ||
|
||
# dwim-print start by checking whether a member 'A' exists in 'self'. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this case, dwim-print will fallback to expression evaluation, because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so this is the same as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As far as the result is concerned, yes. But the code path I'm specifically checking here is the failing check for a member 'A' in |
||
self.expect("dwim-print A.shared", substrs=["42"]) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import Foundation | ||
|
||
class A { | ||
public static var shared = A() | ||
let a = 42 | ||
} | ||
|
||
class C : NSObject { | ||
var c = 0 | ||
func foo() { | ||
print("break here") | ||
c = 1 | ||
} | ||
} | ||
|
||
C().foo() | ||
|
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.
Test accessing a static member from an ObjC inherited class's member function
?