mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Implement a version of projectExistential tailored for LLDB. There are 2
differences when projecting existentials for LLDB:
1 - When it comes to existentials, LLDB stores the address of the error
pointer, which must be dereferenced.
2 - When the existential wraps a class type, LLDB expects the address
returned is the class instance itself and not the address of the
reference.
This patch also adapts the swift reflection test machinery to test
projectExistentialAndUnwrapClass as well. This is done by exposing
the new functionality from swift reflection test. It is tested in
existentials.swift, and ensures that the typeref information is
exactly the same as what is expected from projectExistential,
except the out address.
(cherry picked from commit 55e971e06750c3ba29722d558cc5400298f6bdaf)
34 lines
1.1 KiB
C
34 lines
1.1 KiB
C
//===--- messages.h - Remote reflection testing messages ------------------===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2014 - 2017 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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
static const char *REQUEST_INSTANCE_KIND = "k\n";
|
|
static const char *REQUEST_SHOULD_UNWRAP_CLASS_EXISTENTIAL = "u\n";
|
|
static const char *REQUEST_INSTANCE_ADDRESS = "i\n";
|
|
static const char *REQUEST_REFLECTION_INFO = "r\n";
|
|
static const char *REQUEST_IMAGES = "m\n";
|
|
static const char *REQUEST_READ_BYTES = "b\n";
|
|
static const char *REQUEST_SYMBOL_ADDRESS = "s\n";
|
|
static const char *REQUEST_STRING_LENGTH = "l\n";
|
|
static const char *REQUEST_POINTER_SIZE = "p\n";
|
|
static const char *REQUEST_DONE = "d\n";
|
|
|
|
typedef enum InstanceKind {
|
|
None,
|
|
Object,
|
|
Existential,
|
|
ErrorExistential,
|
|
Closure,
|
|
Enum,
|
|
EnumValue,
|
|
AsyncTask
|
|
} InstanceKind;
|