Commit Graph

13 Commits

Author SHA1 Message Date
Ben Barham
ef8825bfe6 Migrate llvm::Optional to std::optional
LLVM has removed llvm::Optional, move over to std::optional. Also
clang-format to fix up all the renamed #includes.
2024-02-21 11:20:06 -08:00
Adrian Prantl
09da198c93 Add ExternalTypeInfoProvider the the key of the ReflectionContext TypeInfo cache
This change is analogous to the TypeInfo cache in TypeLowering, which does the
exact same thing. In LLDB the ExternalTypeInfoProvider may gain new information
throughout the life of a process, and more importantly, it may return
context-dependent results.

rdar://122432501
2024-02-09 17:24:04 -08:00
Augusto Noronha
e2d516f3c9 Merge pull request #71328 from augusto2112/instance-start-typeref
Implement ReflectionContext::readInstanceStartFromTypeRef
2024-02-02 18:31:05 -08:00
Augusto Noronha
18a80f8941 Implement computeUnalignedFieldStartOffset
Implement computeUnalignedFieldStartOffset as an alternative way to
finding out the start of the fields that belong to the instance when
reading the field's start from binary is not possible (for example,
embedded Swift doesn't emit any reflection metadata on the binary).
2024-02-02 15:38:58 -08:00
Rick van Voorden
f8ae46b3f3 [inclusive-language] changed sanity to soundness 2024-01-25 18:18:02 -08:00
Augusto Noronha
f09f518abc Add interface for lookup up of externally stored type descriptors
Currently, TypeRefBuilder knows how to parse type descriptors from
reflection metadata. We aim to store the same information that lives
in type descriptors externally, as an effort to support embedded Swift
debugging. In order to take advantage of all of the existing type
information parsing code that exists today in remote mirrors, add an
interface for external lookup of type descriptors, and replace all the
usages of type descriptors with their generic counterpart (this patch
only adds support for builtin descriptors, but follow up patches will
add support for other descriptor types).
2023-11-08 15:57:05 -08:00
Emre Celebi
b6f77a46be [swift-inspect] Add an option to print mangled names while dumping generic metadata. 2023-10-30 23:39:42 -07:00
Mike Ash
238d1cdc6c [Reflection] Look for __AUTH segments as well as __DATA segments.
Some data is stored in __AUTH, which we need to add to our list of data segments so that `ownsAddress` works correctly.

rdar://116363531
2023-10-03 12:54:08 -04:00
Augusto Noronha
5282464876 [NFC] Replace std::unordered_map with llvm::DenseSet in metadata reader 2023-09-12 12:41:41 -07:00
Mike Ash
2faa2d6d37 [Reflection] Improve ownsAddress and metadataIsActor logic.
Separately track text and data segments for ownsAddress. We were previously tracking one range per image, encompassing the range from the start of the image through the end of the data segment. This ends up including a lot of unwanted address space if the two aren't adjacent, as is the case for libraries in the shared cache on Darwin.

This makes metadataIsActor a lot more reliable, as it was previously identifying a lot of garbage as actor metadata due to the supposed descriptor pointer falling in this range.

rdar://113417637
2023-08-07 16:49:39 -04:00
Hiroshi Yamauchi
50ef384f88 Fix the swift-inspect dump-generic-metadata operation.
ReflectionContext::allocationMetadataPointer() was reading the
metadata pointer from a wrong offset because of the out-of-sync struct
layouts and dump-generic-metadata was not working correctly.

This change resync's the layouts and adds a static_assert to verify
that the offsets match between GenericMetadataCacheEntry and
GenericCacheEntry.
2023-06-09 18:33:06 -07:00
Dave Lee
af733e7905 [RemoteInspection] Specify precise return type of RecordTypeInfo (NFC) 2023-04-14 11:18:50 -06:00
Alejandro Alonso
382510fa50 Rename Reflection library to RemoteInspection (#62846) 2023-01-06 13:21:32 -05:00