Example #1
0
        private DebugClient(object client, TaskScheduler scheduler)
        {
            _scheduler = scheduler;

            Client        = (IDebugClient5)client;
            Control       = (IDebugControl7)client;
            DataSpaces    = (IDebugDataSpaces4)client;
            SystemObjects = (IDebugSystemObjects2)client;
            Symbols       = (IDebugSymbols5)client;
            Advanced      = (IDebugAdvanced3)client;

            Client.SetEventCallbacksWide(this).ThrowIfFailed();
            Client.SetOutputCallbacksWide(this).ThrowIfFailed();

            Control.AddEngineOptions(DEBUG_ENGOPT.INITIAL_BREAK);
        }
Example #2
0
        public override bool Generate(CommandExecutionContext context)
        {
            _title = Path.GetFileName(context.DumpFile);
            switch (context.TargetType)
            {
            case TargetType.DumpFile:
                DumpType = "Full memory dump with heap";
                break;

            case TargetType.DumpFileNoHeap:
                DumpType = "Mini dump with no heap";
                break;

            default:
                DumpType = "Unsupported dump file type";
                break;
            }
            var target = context.NativeDbgEngTarget;
            IDebugSystemObjects2 sysObjects = (IDebugSystemObjects2)target.DebuggerInterface;
            IDebugControl2       control    = (IDebugControl2)target.DebuggerInterface;

            uint          dummy;
            StringBuilder exeName = new StringBuilder(2048);

            if (HR.Succeeded(sysObjects.GetCurrentProcessExecutableName(exeName, exeName.Capacity, out dummy)))
            {
                ExecutableName = exeName.ToString();
            }

            uint uptime;

            if (HR.Succeeded(sysObjects.GetCurrentProcessUpTime(out uptime)))
            {
                ProcessUpTimeInSeconds = uptime;
            }

            if (HR.Succeeded(control.GetCurrentSystemUpTime(out uptime)))
            {
                SystemUpTimeInSeconds = uptime;
            }

            uint time;

            if (HR.Succeeded(control.GetCurrentTimeDate(out time)))
            {
                SessionTime = DateTimeOffset.FromUnixTimeSeconds(time);
            }

            uint num;

            if (HR.Succeeded(control.GetNumberProcessors(out num)))
            {
                NumberOfProcessors = num;
            }

            uint          platformId, major, minor, servicePackNumber;
            StringBuilder servicePack = new StringBuilder(1048);
            StringBuilder build       = new StringBuilder(1048);

            if (HR.Succeeded(control.GetSystemVersion(out platformId, out major, out minor, servicePack, servicePack.Capacity, out dummy, out servicePackNumber, build, build.Capacity, out dummy)))
            {
                WindowsBuildNumber       = minor;
                WindowsServicePack       = servicePack.ToString();
                WindowsServicePackNumber = servicePackNumber;
                WindowsBuild             = build.ToString();
            }

            ClrVersions.AddRange(context.Runtime.DataTarget.ClrVersions.Select(v => v.Version.ToString()));

            if (context.Runtime.DataTarget.ClrVersions.Any(v => v.Version.Minor == 2))
            {
                Recommendations.Add(new CLRV2Detected());
            }

            return(true);
        }
Example #3
0
 public SystemObjects(IDebugSystemObjects2 systemObjects2)
 {
     _systemObjects2 = systemObjects2;
 }