Generalize JIT debug info register representation for the debugger
- Dominant language
- C#
- Stars
- 18.3k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Description
_Follow-up from https://github.com/dotnet/runtime/pull/129992#discussion_r3530799520_
This issue tracks the remaining work to generalize JIT debug variable-location representation:
- [ ] Add `VLT_SEGMENTS` (for example, `{reg|stack, valueOffset, size}`) to `ICorDebugInfo::VarLoc` and the JIT's `siVarLoc`. Update debug-info serialization, cDAC, R2R, NativeAOT object writers, dumps, and readers. The serialized representation should retain compact encodings for common cases. This will likely require another debug-info/R2R format bump.
- [ ] Generalize `TwoRegisterValueHome` into an N-segment value home and update DBI/VM decoding to reconstruct values from arbitrary register and stack segments.
- [ ] Emit segments for return values using `ReturnTypeDesc`/ABI passing information. Remove the two-register and fixed-eight-byte-piece limitations, enabling three- or four-register HFAs/HVAs and other split returns.
- [ ] Emit segments for enregistered and register/stack-split locals and arguments, improving optimized-code local inspection.
- [ ] Migrate remaining legacy `VLT_REG*`/`VLT_STK*` cases to the segment representation, remove obsolete platform workarounds—including `VLT_REG_FP`—and complete ARM32 support.
Contributor guide
Research direction
Start with ICorDebugInfo::VarLoc and the JIT's siVarLoc, then follow the existing TwoRegisterValueHome handling and the linked follow-up discussion. Trace how debug information is serialized and decoded by DBI/VM, cDAC, R2R, NativeAOT, dumps, and readers. Done means arbitrary register and stack segments are represented, serialized compactly, decoded correctly, and legacy limitations are removed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- compilers, devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100