Skip to content

Disable loading scalars as addresses when materializing an entity var… #1463

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
merged 1 commit into from
Jul 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions lldb/source/Expression/Materializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,7 @@ class EntityVariable : public Materializer::Entity {
}
} else {
AddressType address_type = eAddressTypeInvalid;
const bool scalar_is_load_address = m_is_generic; // this is the only
// time we're dealing
// with dynamic values

const bool scalar_is_load_address = false;
lldb::addr_t addr_of_valobj =
valobj_sp->GetAddressOf(scalar_is_load_address, &address_type);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def test_extension_weak_self (self):
self.do_self_test("Break here for weak self")

@swiftTest
@expectedFailureAll(oslist=["linux"], bugnumber="rdar://31822722")
def test_extension_self (self):
"""Test that we can reconstruct self in method of a class constrained protocol."""
self.build()
Expand Down
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,17 @@
# TestSelfFromRegister.py
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
#
# ------------------------------------------------------------------------------

import lldbsuite.test.lldbinline as lldbinline
from lldbsuite.test.decorators import *

# Test that loading self from a register works as expected
lldbinline.MakeInlineTest(__file__, globals(), decorators=[swiftTest])
13 changes: 13 additions & 0 deletions lldb/test/API/lang/swift/expression/self_from_register/main.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class C : CP {
let f: Int = 12345
}

protocol CP : class {}

extension CP {
func foo() {
print(self) //% self.expect('e f', substrs=[' = 12345'])
}
}

C().foo()