msos.CommandExecutionContext.EnterDbgEngNativeMode C# (CSharp) Method

EnterDbgEngNativeMode() public method

Creates a persistent DbgEng DataTarget that can be used to execute multiple commands (remembers state). While this DataTarget is in place, msos is placed in native DbgEng "mode", and accepts only DbgEng commands.
public EnterDbgEngNativeMode ( ) : void
return void
        public void EnterDbgEngNativeMode()
        {
            _dbgEngDataTarget = CreateDbgEngDataTargetImpl();
        }

Usage Example

示例#1
0
        public void Execute(CommandExecutionContext context)
        {
            context.EnterDbgEngNativeMode();

            // In case the user is going to use sos/sosex, make sure they have
            // the appropriate DAC location configured.
            context.WriteLine("Loading DAC from " + context.DacLocation);
            context.NativeDbgEngTarget.ExecuteDbgEngCommand(
                ".cordll -ve -sd -lp " + Path.GetDirectoryName(context.DacLocation),
                context);

            // SOS hasn't necessarily been loaded at this point; try to load it
            // from the symbol server and then issue the appropriate .load command
            // so that the user can have it immediately available.
            string sosLocation = context.Runtime.TryDownloadSos();
            if (sosLocation == null)
            {
                context.WriteWarning(
                    "Unable to load SOS automatically from symbol server, " +
                    "try to find and .load it manually if needed.");
            }
            else
            {
                context.WriteLine("Loading SOS from " + sosLocation);
                context.NativeDbgEngTarget.ExecuteDbgEngCommand(
                    ".load " + sosLocation,
                    context);
            }
        }
All Usage Examples Of msos.CommandExecutionContext::EnterDbgEngNativeMode