1

Following the documentation on the Debuggable Attribute that is set by the C# compiler and specifically the DebuggingFlags property, there is the flag IgnoreSymbolStoreSequencePoints which seems to be set regardless of Release/Debug configuration in Visual Studio and by csc-Roslyn 3.9 with every permutation of /debug /optimize options.

From what I can gather on the topic (here and here), there are two types of sequence points:

  • explicit - in the SymbolStore, i.e. the pdb file
  • implicit - IL instructions such as nop

So, the question is why does the C# compiler would not even have a command-line option to NOT set IgnoreSymbolStoreSequencePoints flag. As a comparison ilasm allows for use of sequence points from pdb:

/DEBUG          Disable JIT optimization, create PDB file, use sequence points from PDB
/DEBUG=IMPL     Disable JIT optimization, create PDB file, use implicit sequence points
/DEBUG=OPT      Enable JIT optimization, create PDB file, use implicit sequence points

Doesn't this default C# Compiler behavior always prevent a better (although slower) debugging experience when the IgnoreSymbolStoreSequencePoints flag tells the JIT Compiler not to bother looking for sequence points in the pdb file. Or is Visual Studio's Debugger, Other Debugger's ignoring the attribute and still somehow loading explicit symbol points?

tinmanjk
  • 301
  • 1
  • 9
  • 1
    Storing sequence points isn't the *sole purpose* of the pdb file. – Damien_The_Unbeliever Jun 24 '21 at 09:22
  • Does this answer your question? [What is a PDB file?](https://stackoverflow.com/questions/3899573/what-is-a-pdb-file) – Sinatr Jun 24 '21 at 09:40
  • thanks for the comments, did make a significant edit that is more focused on my actual question. – tinmanjk Jun 24 '21 at 17:05
  • This only mattered back in the .NET 1.x days. They figured out a better way to do it at .NET 2.0, turning nops in the MSIL into sequence points, so the flag should always be set. – Hans Passant Jun 24 '21 at 17:41
  • well, aren't nops omitted in optimized builds from the MSIL making debugging there "problematic" even in the presence of .pdb files [link to another question to this point](https://stackoverflow.com/questions/68119621/is-generating-pdb-files-for-third-party-dlls-helping-with-source-stepping-durin) – tinmanjk Jun 24 '21 at 19:06

0 Answers0