Commit Graph

11 Commits

Author SHA1 Message Date
Adrian Prantl
9381a54c67 [RemoteInspection] Change RemoteAbsolutePointer (NFC)
This patch changes RemoteAbsolutePointer to store both the symbol and
the resolved address. This allows us to retire some ugly workarounds
to deal with non-symbolic addresses and it fixes code paths that would
need these workarounds, but haven't implemented them yet (i.e., the
pack shape handling in the symbolicReferenceResolver in MetadatyaReader.

Addresses parts of rdar://146273066.
rdar://153687085
2025-06-18 10:25:15 -07:00
Alastair Houghton
ed69cde535 [StaticMirror] Add support for GLOB_DAT relocations.
We need to support GLOB_DAT relocations to deal with indirect relative
pointers that go via the GOT.

rdar://133510292
2024-08-15 15:05:07 +01:00
Tim Kientzle
1d961ba22d Add #include "swift/Basic/Assertions.h" to a lot of source files
Although I don't plan to bring over new assertions wholesale
into the current qualification branch, it's entirely possible
that various minor changes in main will use the new assertions;
having this basic support in the release branch will simplify that.
(This is why I'm adding the includes as a separate pass from
rewriting the individual assertions)
2024-06-05 19:37:30 -07:00
Ben Troller
bb3c7f5ee8 [RemoteMirror] Allow clients to specify whether Obj-C interop is enabled.
rdar://119570103
2024-01-26 13:11:10 -08:00
Rose
2676117656 Initialize variable to silence warning
This will quiet LLVM.
2023-12-28 10:38:38 -05:00
Alejandro Alonso
382510fa50 Rename Reflection library to RemoteInspection (#62846) 2023-01-06 13:21:32 -05:00
Adrian Prantl
33eb213e28 [swift-reflection-dump] Make ObjC interoperability configurable.
This addresses a FIXME in the code. This allows running swift-reflection-dump
on macOS to dump the contents of an ELF binary.
2022-10-13 17:21:39 -07:00
Dave Lee
cfe0b9774d [Reflection] Update MemoryReader to distinguish related operations (#41530)
Until recently, `MemoryReader` had a single function `resovlePointer` which did two things, and has a somewhat vague name. The two things were:

1. Tool-specific mapping between real addresses and tagged addresses (first implemented in `swift-reflection-dump` and then later in lldb)
2. Finding a "symbol" for a given address

Recently, `resolvePointerAsSymbol` was added, which overloaded the term "resolve" and it added another way to deal with symbols for addresses. Symbols themselves were a bit muddled, as `swift-reflection-dump` was dealing with dynamic symbols aka bindings, while lldb was dealing in regular (static) symbols.

This change separates these two parts of functionality, and also divides symbol lookup into two cases. The API surface will now be:

1. `resolvePointer` for mapping/tagging addresses
3. `getSymbol` for looking up a symbol for an address
4. `getDynamicSymbol` for looking up a dyld binding for an address

Note: each of these names could be improved. Some alternative terms: `lookup` instead of `get`, `Binding` or `BindingName` instead of `DynamicSymbol`. Maybe even another term instead of "resolve". Suggestions welcome!

Currently, `swift-reflection-dump` supports `getDynamicSymbol` but not `getSymbol`. For lldb it's the reverse, `getSymbol` is supported but `getDynamicSymbol` needs to be implemented.

For everything but lldb, this change is NFC. For lldb it fixes a bug where `LLDBMemoryReader` returns regular symbols where we should instead be returning dynamic symbols.
2022-03-11 22:36:20 -08:00
Artem Chikin
458eccca5f [LibSwiftScan] Add entry-points for querying protocol conformances from the static mirror
This commit adds new entry-points to `libSwiftScan` that operate on the new BinaryScanningTool, which reads out Swift type information from object files, starting with a query of all protocol conformances.
2022-02-02 11:56:17 -08:00
Artem Chikin
e934fe201a Add extraction protocol conformance descriptor extraction, as read from an object file image, to TypeRefBuilder. 2022-01-26 13:54:02 -08:00
Artem Chikin
f3d784fd0f Factor out Object File handling from swift-reflection-dump to separate CMake target: StaticMirror
This target will then be used to have a broader set of tools for reading metadata from object files.
2022-01-24 16:49:01 -08:00