Skip to content

Enable LLDB symbol lookup from separate dSYM files - #6060

Merged
max-charlamb merged 1 commit into
dotnet:mainfrom
max-charlamb:dev/max-charlamb/lldb-dsym-symbol-lookup
Sep 23, 2026
Merged

max-charlamb merged 1 commit into
dotnet:mainfrom
max-charlamb:dev/max-charlamb/lldb-dsym-symbol-lookup

Conversation

@max-charlamb

Copy link
Copy Markdown
Member

Summary

Update the SOS LLDB services to fall back to the symbol file associated with a loaded module when a symbol cannot be resolved from the module itself.

The fallback:

  • Gets the associated symbol file through SBModule::GetSymbolFileSpec.
  • Opens that file as a separate SBModule.
  • Supports both symbol-name-to-address and address-to-symbol-name lookups.
  • Translates between the symbol file's link-time addresses and the loaded module's runtime addresses.

Background

LLDB can associate a dSYM with a loaded Mach-O module and use its DWARF information, but local symbols from the dSYM's Mach-O symbol table are not always exposed through the loaded module's normal symbol lookup APIs.

Opening the associated symbol file as a separate SBModule makes those symbols available without requiring SOS to locate the dSYM or parse its Mach-O symbol table directly.

If no associated symbol file exists, or the symbol is not present in it, lookup retains the existing failure behavior.

Testing

  • Built SOS for macOS arm64.
  • Verified name-to-address lookup for local symbols stored only in a dSYM.
  • Verified address-to-name lookup for local symbols stored only in a dSYM.
  • Verified address translation when the loaded module has a runtime slide.

Fall back to the symbol file associated with a loaded module when LLDB cannot resolve local Mach-O symbols through the module itself. Translate between link-time and runtime addresses for both lookup directions.

Co-authored-by: Copilot <[email protected]>
@max-charlamb
max-charlamb requested a review from a team as a code owner September 23, 2026 15:08
@max-charlamb
max-charlamb requested review from steveisok and a lite review from Copilot September 23, 2026 15:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Address dSYM module caching and architecture selection, and add regression coverage.

Review effort: Lite
Findings: None

What changed in this PR

Adds LLDB SOS fallback symbol lookup through associated dSYM files, including name/address resolution and runtime slide translation.

Changes:

  • Resolves symbols from separate dSYM modules.
  • Supports both lookup directions.
  • Translates link-time and runtime addresses.
File Summary Review findings
src/​SOS/​lldbplugin/​services.cpp Implements dSYM fallback lookup and address translation. Moderate (1): cache symbol modules. Moderate (1): preserve the loaded module’s architecture/triple. Nit (1): add automated macOS regression coverage.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@max-charlamb
max-charlamb merged commit dae8f49 into dotnet:main Sep 23, 2026
23 checks passed
@max-charlamb
max-charlamb deleted the dev/max-charlamb/lldb-dsym-symbol-lookup branch September 23, 2026 19:44
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants