Proposal: debug information SymbolReader for Portable PDB, Linux
To support setting breakpoints on managed code by source file + line number on Linux (see dotnet/coreclr#4798 ) we need a reader of the source line information form Portable PDB. This reader should be private to SOS. We propose a managed assembly with the interface close to existing SymbolReader class in SOS (strike.cpp).
namespace System.Diagnostics.Debug
{
public class SymbolReader
{
/// <summary>
/// Checks availability of debugging information for given assembly.
/// </summary>
/// <param name="assemblyName">file name of the assembly</param>
/// <returns>true if debugging information is available</returns>
public static bool LoadSymbolsForModule(string assemblyName)
{
}
/// <summary>
/// Returns method token and IL offset for given source line number.
/// </summary>
/// <param name="assemblyName">file name of the assembly</param>
/// <param name="fileName">source file name</param>
/// <param name="lineNumber">source line number</param>
/// <param name="methToken">method token return</param>
/// <param name="ilOffset">IL offset return</param>
public static void ResolveSequencePoint(string assemblyName, string fileName, int lineNumber, out int methToken, out int ilOffset)
{
}
}
}
We also consider implementation using basically the same technique as in symbol support helper class for mscorlib's StackTrace (see dotnet/corefx#8670) cc @seanshpark @mikem8361 @lucenticus
Yes, this looks like a good proposal. You can use the xplat hosting api coreclr_create_delegate to get these managed entry points in the native SOS code.
cc @chunseoklee
I'm going to close this issue now that PR dotnet/corefx#9281 has been merged.
@terrajobst @KrzysztofCwalina
Were these APIs reviewed?
Moved to new private SOS assembly in the coreclr repo. No longer needs to be reviewed.