예제 #1
0
        private DateTimeOffset _GetDbgEngLastEventTimestamp()
        {
            // Example:
            //
            //    Last event: ac8.2f8: Break instruction exception - code 80000003 (first/second chance not available)
            //      debugger time: Mon Oct 20 06:41:19.392 2014 (UTC - 7:00)

            DateTimeOffset timestamp = DateTimeOffset.MinValue;

            using (m_debugger.HandleDbgEngOutput((x) =>
            {
                x = x.Trim();
                const string debuggerTime = "debugger time: ";

                if (x.StartsWith(debuggerTime, StringComparison.OrdinalIgnoreCase))
                {
                    var tsStr = x.Substring(debuggerTime.Length);
                    if (!DbgProvider.TryParseDebuggerTimestamp(tsStr,
                                                               out timestamp))
                    {
                        var msg = Util.Sprintf("Huh... unable to parse dbgeng timestamp: {0}", tsStr);
                        LogManager.Trace(msg);
                        Util.Fail(msg);
                    }
                }
            }))
            {
                m_debugger.InvokeDbgEngCommand(".lastevent", false);
            }
            return(timestamp);
        } // end _GetDbgEngLastEventTimestamp()