runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Proposal: debug information SymbolReader for Portable PDB, Linux

Open Dmitri-Botcharnikov opened this issue 10 years ago • 5 comments

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

Dmitri-Botcharnikov avatar May 31 '16 12:05 Dmitri-Botcharnikov

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.

mikem8361 avatar May 31 '16 18:05 mikem8361

cc @chunseoklee

seanshpark avatar May 31 '16 23:05 seanshpark

I'm going to close this issue now that PR dotnet/corefx#9281 has been merged.

mikem8361 avatar Jun 15 '16 16:06 mikem8361

@terrajobst @KrzysztofCwalina

Were these APIs reviewed?

weshaggard avatar Jun 28 '16 18:06 weshaggard

Moved to new private SOS assembly in the coreclr repo. No longer needs to be reviewed.

mikem8361 avatar Aug 19 '16 23:08 mikem8361