Search code examples
windbgsossosex

Source code information missing with SOS/SOSEX


I'm using cdb with the sosex extension. Everything seems to be working fine except that I am unable to get any !mbp breakpoints to to resolve and !mu/!muf don't show source info.

Got going with the following commands:

.lines
sxe ld:clrjit
g
.loadby sos clr
.cordll -ve -u -l
.load c:\blah\sosex.dll
sxe ld:myassembly.dll
ld myassembly
!mbm myassembly!myfunction
g

It then hits the function I'm interested in and breaks. However !mu doesn't show any source info, only IL and native.

I verified that the symbols, including source lines info, were loaded by doing:

? `myassembly!c:\blah\whatevs.cs:20`

which prints out a correct offset.

SOSEX version is the latest from stevestechspot. Running against .NET Framework 4.7.3. cdb and sosex both x64.

Source file locations on the machine match those in the PDB file.

UPDATE

Having the same problem with SOS. IP2MD doesn't show the source line.


Solution

  • I debugged through sos.dll, and it correctly translated the native address to an IL address and passed the resulting IL address to a function in dbgeng, DebugClient::GetLineByOffset(). However this returned E_FAIL, which from the disassembly it appears hardcoded to do.

    So it looks like SOS relies on something that is no longer implemented in the debugger engine to get the source line from the IL offset.

    Reported: https://developercommunity.visualstudio.com/content/problem/414350/sos-debugger-extension-for-windbg-cant-find-source.html

    Was told to report it as a WDK issue - raised here: https://social.msdn.microsoft.com/Forums/en-US/2f9d4bbe-8322-4e8d-883a-e40d19f21209/sos-debugger-extension-for-windbg-cant-find-source-lines?forum=wdk