Prefer public symbols for SOS name resolution - #5991
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0ce5fe67-5901-4841-abbe-16f5285cdf4f
There was a problem hiding this comment.
🟡 Changes recommended
The current implementation unnecessarily depends on IDebugSymbols5 (reducing compatibility) and should be adjusted to use the base IDebugSymbols interface (and/or explicitly fail when unavailable) as part of the intended behavior.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates SOS’s DbgEng integration to make name-by-address symbol resolution prefer stable COFF public symbol names (over CodeView display names), and to surface failures when that configuration cannot be applied—supporting reliable, reversible symbol names (notably for NativeAOT).
Changes:
- Enables
SYMOPT.PUBLICS_ONLYin DbgEng to prefer public symbol names for lookups. - Returns the symbol-option enablement error from
GetSymbolByOffsetwhen the option could not be enabled.
File summaries
| File | Description |
|---|---|
| src/SOS/SOS.Extensions/DebuggerServices.cs | Enables DbgEng public-symbol-only option and gates GetSymbolByOffset on successful option configuration. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Explain why SOS prefers stable COFF public names over debugger-friendly CodeView display names. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2d5c60f7-9c89-42e6-b9fc-04ef78c8f8d8
Summary
Motivation
NativeAOT now emits debugger-friendly names in CodeView procedure records while retaining the existing COFF public symbol names. DbgEng prefers the CodeView display names, but diagnostic tooling relies on the stable, reversible public names.
See dotnet/runtime#132735.
Testing