Repository navigation
Avoid changing global SOS symbol options - #6242
Merged
Merged
Conversation
Resolve public names per query and calculate displacement from the selected symbol address without changing debugger options. Co-authored-by: Copilot <[email protected]> Copilot-Session: 56b7f1ec-323f-44e6-bee9-b2af0e9fc062
hoyosjs
approved these changes
Nov 14, 2026
hoyosjs
left a comment
Member
There was a problem hiding this comment.
Main concern is the impact of this for something like FindPointersIn - this is 5-8 COM calls per frame.
- Also - if this is too slow we could cache the module name per module index and clear that on module change.
- The interface casts can be done one in the constructor just like
DebugClientto avoid this getting done per frame. - I don't think we use this for special names, but for things that are ambiguous like overrides, GetOffsetByName returns
S_FALSE(I don't think what we care about has those?). The main risk here is if there's code folding. - Should we fall back to
GetNameByOffsetwhen no public symbol is found?
This was referenced Nov 15, 2026
hoyosjs
pushed a commit
that referenced
this pull request
Nov 17, 2026
## Summary A faster replacement for the public-name reverse lookup introduced in #6242: - Select the public name with `IDebugAdvanced2.GetSymbolInformation(GET_SYMBOL_NAME_BY_OFFSET_AND_TAG_WIDE, address, SymTagPublicSymbol)`. - Obtain displacement with an ordinary, unfiltered `IDebugSymbols3.GetNameByOffsetWide` call instead of reverse-resolving the public name with `GetOffsetByNameWide`. - Keep this policy in a module-owned `DbgEngModuleSymbols` helper, leaving `DebuggerServices` as the low-level wrapper. - Preserve export-only name retry and failure propagation, without changing global symbol options or enumerating/caching module symbols. ## Performance Measured on Windows x64 using a synthetic workload with 100,000 generated methods and 215,422 public PDB symbols: | Approach | Warm time/query | Startup through first lookup | Retained managed-memory delta | |---|---:|---:|---:| | Original `GetNameByOffset` with global `PUBLICS_ONLY` | 17.47 us | 36.99 ms | 1,600 bytes | | Scoped public-name + reverse-lookup algorithm (prior measurement) | 1.392 s | 1,529 ms | 4,224 bytes | | This PR: public name + ordinary displacement | 24.49 us | 75.75 ms | 3,120 bytes | The proposed lookup avoids the expensive reverse-name lookup. Compared with the original global-public-only behavior, warm lookup time is approximately 40.2% higher (+7.02 us/query). There is no module-wide symbol cache. ## Known correctness limitations Ordinary lookup can select a private symbol with a different starting address from the selected public symbol. Pairing its displacement with the public name can therefore report an incorrect public-symbol start. Against an original-public-only reference: - All 300,563 generated-method queries matched both name and displacement. - Of 343,166 normal reference queries, 343,144 matched and 22 had different displacements. These are native code/data cases; this prototype does not fix them. - An additional 474 cross-section `<PERF>` formatting differences and one before-first-public boundary difference were recorded separately. --------- Co-authored-by: Max Charlamb <[email protected]> Co-authored-by: Copilot <[email protected]> Copilot-Session: 56b7f1ec-323f-44e6-bee9-b2af0e9fc062
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove the session-wide
SYMOPT.PUBLICS_ONLYsetting introduced in #5991. Loading SOS should not change how the debugger or other extensions resolve symbols.For managed SOS symbol lookups under DbgEng, request the public symbol name with
IDebugAdvanced2.GetSymbolInformation(GET_SYMBOL_NAME_BY_OFFSET_AND_TAG_WIDE, SymTagPublicSymbol), then resolve that module-qualified name withGetOffsetByNameWide. Calculate displacement from the selected public symbol's address rather than reusing a private symbol's displacement. LLDB retains its existing lookup path.The implementation also handles two behaviors observed with real DbgEng calls:
Ambiguous or failed address resolution does not return a partial symbol result.
Validation