1

I've compiled my assemby with embedded symbols:

namespace SymbolsTest
{
    static class Program
    {
        private static void Main()
        {
            var now = System.DateTime.Now;
            System.Console.WriteLine($"Now:  {now}");
        }
    }
}
csc SymbolsTest.cs /target:exe /platform:x64 /debug+ /debug:embedded /out:SymbolsTest_x64.exe

When I try to load the symbols in WinDbg, I get an error in the symbol loading:

0:000> !CLRStack
OS Thread Id: 0x21e4 (0)
        Child SP               IP Call Site
0000000000dfe940 00007ffa7a0b6004 [PrestubMethodFrame: 0000000000dfe940] SymbolsTest.Program.Main()
0000000000dfee30 00007ffa7a0b6004 [GCFrame: 0000000000dfee30] 
0:000> .reload
Reloading current modules
................................
0:000> .reload /f
Reloading current modules
.*** WARNING: Unable to verify checksum for SymbolsTest_x64.exe
*** ERROR: Module load completed but symbols could not be loaded for SymbolsTest_x64.exe
...........*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\Program Files\Avecto\Privilege Guard Client\PGHook.dll - 
....................

************* Symbol Loading Error Summary **************
Module name            Error
SymbolsTest_x64        0x80190194 - Not found (404). : srv*c:\symbols*http://msdl.microsoft.com/download/symbols
PGHook                 0x80190194 - Not found (404). : srv*c:\symbols*http://msdl.microsoft.com/download/symbols

You can troubleshoot most symbol related issues by turning on symbol loading diagnostics (!sym noisy) and repeating the command that caused symbols to be loaded.
You should also verify that your symbol search path (.sympath) is correct.

The sympath is set correctly (what I think is correct):

0:000> .sympath
Symbol search path is: srv*C:\Symbols*http://msdl.microsoft.com/download/symbols
Expanded Symbol search path is: srv*c:\symbols*http://msdl.microsoft.com/download/symbols

************* Path validation summary **************
Response                         Time (ms)     Location
Deferred                                       srv*C:\Symbols*http://msdl.microsoft.com/download/symbols

How so I tell the debugger to that the symbols are embedded in the file?

BanksySan
  • 27,362
  • 33
  • 117
  • 216
  • have you tried :full and does it work do you get a pdb – blabb Oct 08 '18 at 13:32
  • Where did you get the `/debug:embedded` option from? Not documented [here](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/debug-compiler-option) at least. – Thomas Weller Oct 08 '18 at 21:45
  • @thomas do csc /? and look at help for debug options there are supposed to be 4 options including embedded default is full – blabb Oct 09 '18 at 02:45
  • @blabb Aye, if I create the debug file and add it to the symbol server it's fine. – BanksySan Oct 09 '18 at 10:31
  • then ptobably embedded has an issue it appears to be semi / unofficial feature some rosalyn boards has reference to its usage with sourcelink feature you may have to look in insider previews – blabb Oct 09 '18 at 13:38
  • @blabb maybe that's it, I thought it would be less hassle than constantly adding the symbols locally. – BanksySan Oct 09 '18 at 13:45
  • @BanksySan: usually you'd not embedd symbols. They can grow some MB, which might affect deploy size and affect loading time of DLLs as well as memory used by DLLs (nothing bad for 64 bit, though). Also, for closed source apps you'd not like to ship symbols. – Thomas Weller Oct 09 '18 at 17:45
  • @ThomasWeller This is just for poking about with the debuggers, I thought that embedded symbols might save me having to add the symbols file to the local symbol store. I'd never embed them on a _real_ application. – BanksySan Oct 09 '18 at 17:58

0 Answers0