Commit Graph

9 Commits

Author SHA1 Message Date
Carl Peto 8b87e3db49 [Backtracing] [Windows] Bugfixes for windows image crash logs (#89218)
- Fix issue with no build id showing up as `000000`... (e.g. no debug
info), now shows as `<no build id>` as intended.
- Try to avoid loading PE file unless it's necessary on Windows
symbolicating backtraces.
- DefaultSymbolLocator: PDB file finding now respects the overridable
path for use in the offline symbolicator (no effect on standard
backtracing).
- Record timestamp/size in Image Info on windows for possible future use
in offline symbolicator

---------

Co-authored-by: Carl Peto <carlpeto@Carls-MacBook-Pro.local>
2026-05-19 16:35:38 +01:00
Carl Peto 550364fadd [Backtracing] Extra SPI for offline symbolicator (#88481)
- **Explanation**:
Add extra SPI to be able to override find methods (for offline
symbolication fetch).

- **Scope**:
No functional change to existing SPI, adds new SPI (and two methods
changed from `public` to `open`).

- **Issues**:
rdar://136978398

- **Original PRs**:
n/a

- **Risk**:
none

- **Testing**:
tested in a local build on Darwin and Linux

- **Reviewers**:
@al45tair

Co-authored-by: Carl Peto <carlpeto@Carls-MacBook-Pro.local>
2026-04-20 15:46:48 +01:00
Alastair Houghton 5ea6cf2bc0 [Backtracing] Fix a type error and a warning.
For some reason `DWORD` is `UInt` rather than `UInt32`, which seems wrong.
Anyway, be explicit and use `UInt32` instead.

Also, ignore the image path result from `findElf`, to get rid of a warning.

rdar://172911008
2026-03-20 13:44:37 +00:00
Carl Peto 4cc9c7638a [Backtracing] Fix cross platform symbolication. (#87490)
Refactoring to allow override on the hard coded image
paths in crash logs. To allow cross platform
offline symbolication.

Co-authored-by: Carl Peto <carlpeto@Carls-MacBook-Pro.local>
Co-authored-by: Alastair Houghton <alastair@alastairs-place.net>
2026-03-04 12:18:56 -08:00
Alastair Houghton 81f477e4a7 [Backtracing] Reorganise thread locals.
Reorganise the thread locals for the backtracing code in the `Runtime` module so
that there’s only one set of them, with everything else hanging off that. This
also reduces code duplication and consumption of thread local variable space.

Fix the `DefaultSymbolLocator`’s shared instance to be thread local.

rdar://171432566
2026-02-28 16:56:05 +00:00
Alastair Houghton 0c32b10ee6 [Backtracing] baseAddress is Optional, so we need a ! here.
I don't understand how this passed PR testing (or built) previously,
but it did both, then started failing.

rdar://170887396
2026-02-23 10:24:45 +00:00
Alastair Houghton 245b5e0766 [Backtracing] Add the ability for a SymbolLocator to find images.
This is better than the `alternativePaths` mechanism because it means that
a client of the `Runtime` module can do its own thing, which might even
mean fetching things from a remote server or decompressing files or any
other thing we might find useful.

rdar://170642627
2026-02-18 16:59:52 +00:00
Alastair Houghton e7f603fd25 [Backtracing][PDB] For ELF, always return the image file.
ELF images typically do contain symbols, unlike PE-COFF images.

rdar://168454023
2026-02-17 12:24:51 +00:00
Alastair Houghton acdaeef626 [Backtracing][PDB] Add PDB code and SymbolLocator.
Added the PDB reading code and also a `SymbolLocator` type that
allows us to locate symbols for a given image.

rdar://168454023
2026-02-17 10:50:55 +00:00