src/debug/netcoredbg/SymbolReader.cs
/// <summary>
/// Checks availability of debugging information for given assembly.
/// </summary>
/// <param name="assemblyPath">
/// File path of the assembly or null if the module is in-memory or dynamic (generated by Reflection.Emit)
/// </param>
/// <param name="isFileLayout">type of in-memory PE layout, if true, file based layout otherwise, loaded layout</param>
/// <param name="loadedPeAddress">
/// Loaded PE image address or zero if the module is dynamic (generated by Reflection.Emit). 
/// Dynamic modules have their PDBs (if any) generated to an in-memory stream 
/// (pointed to by <paramref name="inMemoryPdbAddress"/> and <paramref name="inMemoryPdbSize"/>).
/// </param>
/// <param name="loadedPeSize">loaded PE image size</param>
/// <param name="inMemoryPdbAddress">in memory PDB address or zero</param>
/// <param name="inMemoryPdbSize">in memory PDB size</param>
/// <returns>Symbol reader handle or zero if error</returns>
Checks availability of debugging information for given assembly.
Checks availability of debugging information for given assembly .
internal static IntPtr LoadSymbolsForModule([MarshalAs(UnmanagedType.LPWStr)] string assemblyPath, bool isFileLayout, ulong loadedPeAddress, int loadedPeSize, 
            ulong inMemoryPdbAddress, int inMemoryPdbSize, ReadMemoryDelegate readMemory)
        {
            try
            {
                TargetStream peStream = null;
                if (assemblyPath == null && loadedPeAddress != 0)
                {
                    peStream = new TargetStream(loadedPeAddress, loadedPeSize, readMemory);
                }
                TargetStream pdbStream = null;
                if (inMemoryPdbAddress != 0)
                {
                    pdbStream = new TargetStream(inMemoryPdbAddress, inMemoryPdbSize, readMemory);
                }
                OpenedReader openedReader = GetReader(assemblyPath, isFileLayout, peStream, pdbStream);
                if (openedReader != null)
                {
                    GCHandle gch = GCHandle.Alloc(openedReader);
                    return GCHandle.ToIntPtr(gch);
                }
            }
            catch
            {
            }
            return IntPtr.Zero;
        }
internal static IntPtr LoadSymbolsForModule ( [ MarshalAs ( UnmanagedType . LPWStr ) ] string assemblyPath , bool isFileLayout , ulong loadedPeAddress , int loadedPeSize , ulong inMemoryPdbAddress , int inMemoryPdbSize , ReadMemoryDelegate readMemory ) { try { TargetStream peStream = null ; if ( assemblyPath == null && loadedPeAddress != 0 ) { peStream = new TargetStream ( loadedPeAddress , loadedPeSize , readMemory ) ; } TargetStream pdbStream = null ; if ( inMemoryPdbAddress != 0 ) { pdbStream = new TargetStream ( inMemoryPdbAddress , inMemoryPdbSize , readMemory ) ; } OpenedReader openedReader = GetReader ( assemblyPath , isFileLayout , peStream , pdbStream ) ; if ( openedReader != null ) { GCHandle gch = GCHandle . Alloc ( openedReader ) ; return GCHandle . ToIntPtr ( gch ) ; } } catch { } return IntPtr . Zero ; }
Checks availability of debugging information for given assembly.
Checks availability of debugging information for given assembly .
Symbol reader handle or zero if error
Symbol reader handle or zero if error
string
[MarshalAs(UnmanagedType.LPWStr)]
isFileLayout
bool
type of in-memory PE layout, if true, file based layout otherwise, loaded layout
type of in - memory PE layout if true file based layout otherwise loaded layout
loadedPeAddress
ulong
Loaded PE image address or zero if the module is dynamic (generated by Reflection.Emit).
Dynamic modules have their PDBs (if any) generated to an in-memory stream
(pointed to by  and ).
Loaded PE image address or zero if the module is dynamic ( generated by Reflection . Emit ) . Dynamic modules have their PDBs ( if any ) generated to an in - memory stream ( pointed to by and ) .
loadedPeSize
int
loaded PE image size
loaded PE image size
inMemoryPdbAddress
ulong
in memory PDB address or zero
in memory PDB address or zero
inMemoryPdbSize
int
in memory PDB size
in memory PDB size
readMemory
ReadMemoryDelegate
assemblyPath
File path of the assembly or null if the module is in-memory or dynamic (generated by Reflection.Emit)
File path of the assembly or null if the module is in - memory or dynamic ( generated by Reflection . Emit )