Пример #1
0
        ///////////////////////////////////////////////////////////////////////

        private static void AddInfo(
            AppDomainSetup appDomainSetup,
            StringPairList list,
            DetailFlags detailFlags
            )
        {
            if (list == null)
            {
                return;
            }

            if (appDomainSetup != null)
            {
                bool empty = HostOps.HasEmptyContent(detailFlags);

                if (empty || (appDomainSetup.ApplicationBase != null))
                {
                    list.Add("ApplicationBase",
                             appDomainSetup.ApplicationBase);
                }

                if (empty || (appDomainSetup.PrivateBinPath != null))
                {
                    list.Add("PrivateBinPath",
                             appDomainSetup.PrivateBinPath);
                }
            }
            else
            {
                list.Add(FormatOps.DisplayNull);
            }
        }
Пример #2
0
        ///////////////////////////////////////////////////////////////////////

        //
        // BUGFIX: *DEADLOCK* Prevent deadlocks here by using the TryLock
        //         pattern.
        //
        // NOTE: Used by the _Hosts.Default.WriteEngineInfo method.
        //
        public static void AddInfo(
            StringPairList list,
            DetailFlags detailFlags
            )
        {
            if (list == null)
            {
                return;
            }

            bool locked = false;

            try
            {
                TryLock(ref locked); /* TRANSACTIONAL */

                if (locked)
                {
                    bool           empty     = HostOps.HasEmptyContent(detailFlags);
                    StringPairList localList = new StringPairList();

                    if (empty || (isAvailable != null))
                    {
                        localList.Add("IsAvailable", (isAvailable != null) ?
                                      isAvailable.ToString() : FormatOps.DisplayNull);
                    }

                    if (empty || locked)
                    {
                        localList.Add("Locked", locked.ToString());
                    }

                    if (empty || disabled)
                    {
                        localList.Add("Disabled", disabled.ToString());
                    }

                    if (empty || strictPath)
                    {
                        localList.Add("StrictPath", strictPath.ToString());
                    }

                    if (empty || noReflection)
                    {
                        localList.Add("NoReflection", noReflection.ToString());
                    }

                    if (empty || (nativeModule != IntPtr.Zero))
                    {
                        localList.Add("NativeModule", nativeModule.ToString());
                    }

                    if (empty || (nativeFileName != null))
                    {
                        localList.Add("NativeFileName", (nativeFileName != null) ?
                                      nativeFileName : FormatOps.DisplayNull);
                    }

                    if (empty || ((nativeDelegates != null) && (nativeDelegates.Count > 0)))
                    {
                        localList.Add("NativeDelegates", (nativeDelegates != null) ?
                                      nativeDelegates.Count.ToString() : FormatOps.DisplayNull);
                    }

                    if (empty || (nativeGetVersion != null))
                    {
                        localList.Add("NativeGetVersion", (nativeGetVersion != null) ?
                                      nativeGetVersion.ToString() : FormatOps.DisplayNull);
                    }

                    if (empty || (nativeAllocateMemory != null))
                    {
                        localList.Add("NativeAllocateMemory", (nativeAllocateMemory != null) ?
                                      nativeAllocateMemory.ToString() : FormatOps.DisplayNull);
                    }

                    if (empty || (nativeFreeMemory != null))
                    {
                        localList.Add("NativeFreeMemory", (nativeFreeMemory != null) ?
                                      nativeFreeMemory.ToString() : FormatOps.DisplayNull);
                    }

                    if (empty || (nativeFreeElements != null))
                    {
                        localList.Add("NativeFreeElements", (nativeFreeElements != null) ?
                                      nativeFreeElements.ToString() : FormatOps.DisplayNull);
                    }

                    if (empty || (nativeSplitList != null))
                    {
                        localList.Add("NativeSplitList", (nativeSplitList != null) ?
                                      nativeSplitList.ToString() : FormatOps.DisplayNull);
                    }

                    if (empty || (nativeJoinList != null))
                    {
                        localList.Add("NativeJoinList", (nativeJoinList != null) ?
                                      nativeJoinList.ToString() : FormatOps.DisplayNull);
                    }

                    if (empty || (version != null))
                    {
                        localList.Add("Version", (version != null) ?
                                      version : FormatOps.DisplayNull);
                    }

                    if (empty || (itemsFieldInfo != null))
                    {
                        localList.Add("ItemsFieldInfo", (itemsFieldInfo != null) ?
                                      itemsFieldInfo.ToString() : FormatOps.DisplayNull);
                    }

                    if (empty || Parser.UseNativeSplitList)
                    {
                        localList.Add("UseNativeSplitList",
                                      Parser.UseNativeSplitList.ToString());
                    }

                    if (empty || GenericOps <string> .UseNativeJoinList)
                    {
                        localList.Add("UseNativeJoinList",
                                      GenericOps <string> .UseNativeJoinList.ToString());
                    }

                    if (localList.Count > 0)
                    {
                        list.Add((IPair <string>)null);
                        list.Add("Native Utility");
                        list.Add((IPair <string>)null);
                        list.Add(localList);
                    }
                }
                else
                {
                    StringPairList localList = new StringPairList();

                    localList.Add(FormatOps.DisplayBusy);

                    if (localList.Count > 0)
                    {
                        list.Add((IPair <string>)null);
                        list.Add("Native Utility");
                        list.Add((IPair <string>)null);
                        list.Add(localList);
                    }
                }
            }
            finally
            {
                ExitLock(ref locked); /* TRANSACTIONAL */
            }
        }
Пример #3
0
        ///////////////////////////////////////////////////////////////////////

        #region Internal State Introspection Methods
        //
        // NOTE: Used by the _Hosts.Default.BuildEngineInfoList method.
        //
        public static void AddInfo(
            StringPairList list,
            DetailFlags detailFlags
            )
        {
            if (list == null)
            {
                return;
            }

            lock (syncRoot) /* TRANSACTIONAL */
            {
                bool           empty     = HostOps.HasEmptyContent(detailFlags);
                StringPairList localList = new StringPairList();

                if (empty || isTracePossible)
                {
                    localList.Add("IsTracePossible",
                                  isTracePossible.ToString());
                }

                if (empty || (tracePriorities != TracePriority.None))
                {
                    localList.Add("TracePriorities",
                                  tracePriorities.ToString());
                }

                if (empty || (defaultTracePriority != TracePriority.None))
                {
                    localList.Add("DefaultTracePriority",
                                  defaultTracePriority.ToString());
                }

                if (empty || isTraceEnabledByDefault)
                {
                    localList.Add("IsTraceEnabledByDefault",
                                  isTraceEnabledByDefault.ToString());
                }

                if (empty || (isTraceEnabled != null))
                {
                    localList.Add("IsTraceEnabled", (isTraceEnabled != null) ?
                                  isTraceEnabled.ToString() : FormatOps.DisplayNull);
                }

                if (empty || (traceFormat != null))
                {
                    localList.Add("TraceFormat",
                                  FormatOps.DisplayString(traceFormat));
                }

                if (empty || traceDateTime)
                {
                    localList.Add("TraceDateTime",
                                  traceDateTime.ToString());
                }

                if (empty || tracePriority)
                {
                    localList.Add("TracePriority",
                                  tracePriority.ToString());
                }

                if (empty || traceAppDomain)
                {
                    localList.Add("TraceAppDomain",
                                  traceAppDomain.ToString());
                }

                if (empty || traceInterpreter)
                {
                    localList.Add("TraceInterpreter",
                                  traceInterpreter.ToString());
                }

                if (empty || traceThreadId)
                {
                    localList.Add("TraceThreadId",
                                  traceThreadId.ToString());
                }

                if (empty || traceMethod)
                {
                    localList.Add("TraceMethod",
                                  traceMethod.ToString());
                }

                if (empty || (traceCategories != null))
                {
                    localList.Add("TraceCategories", (traceCategories != null) ?
                                  traceCategories.KeysAndValuesToString(null, false) :
                                  FormatOps.DisplayNull);
                }

                if (localList.Count > 0)
                {
                    list.Add((IPair <string>)null);
                    list.Add("Trace Information");
                    list.Add((IPair <string>)null);
                    list.Add(localList);
                }
            }
        }
Пример #4
0
        ///////////////////////////////////////////////////////////////////////

        #region IDebugger Members
        public void AddInfo(
            StringPairList list,
            DetailFlags detailFlags
            )
        {
            CheckDisposed();

            bool empty = HostOps.HasEmptyContent(detailFlags);

            if (empty || (suspendCount > 0))
            {
                list.Add("SuspendCount", suspendCount.ToString());
            }

            if (empty || Enabled)
            {
                list.Add("Enabled", Enabled.ToString());
            }

            if (empty || (Loops > 0))
            {
                list.Add("Loops", Loops.ToString());
            }

            if (empty || (Active > 0))
            {
                list.Add("Active", Active.ToString());
            }

            if (empty || SingleStep)
            {
                list.Add("SingleStep", SingleStep.ToString());
            }

#if BREAKPOINTS
            if (empty || BreakOnToken)
            {
                list.Add("BreakOnToken", BreakOnToken.ToString());
            }
#endif

            if (empty || BreakOnExecute)
            {
                list.Add("BreakOnExecute", BreakOnExecute.ToString());
            }

            if (empty || BreakOnCancel)
            {
                list.Add("BreakOnCancel", BreakOnCancel.ToString());
            }

            if (empty || BreakOnError)
            {
                list.Add("BreakOnError", BreakOnError.ToString());
            }

            if (empty || BreakOnReturn)
            {
                list.Add("BreakOnReturn", BreakOnReturn.ToString());
            }

            if (empty || BreakOnTest)
            {
                list.Add("BreakOnTest", BreakOnTest.ToString());
            }

            if (empty || BreakOnExit)
            {
                list.Add("BreakOnExit", BreakOnExit.ToString());
            }

            if (empty || (Steps > 0))
            {
                list.Add("Steps", Steps.ToString());
            }

            if (empty || (Types != BreakpointType.None))
            {
                list.Add("Types", Types.ToString());
            }

#if BREAKPOINTS
            BreakpointDictionary breakpoints = Breakpoints;

            if (empty || ((breakpoints != null) && (breakpoints.Count > 0)))
            {
                list.Add("Breakpoints", (breakpoints != null) ?
                         breakpoints.Count.ToString() : FormatOps.DisplayNull);
            }
#endif

#if DEBUGGER_ARGUMENTS
            ArgumentList executeArguments = ExecuteArguments;

            if (empty || (executeArguments != null))
            {
                list.Add("ExecuteArguments", (executeArguments != null) ?
                         executeArguments.ToString(ToStringFlags.NameAndValue,
                                                   null, false) : FormatOps.DisplayNull);
            }
#endif

            if (empty || !String.IsNullOrEmpty(Command))
            {
                list.Add("Command", FormatOps.DisplayString(
                             FormatOps.ReplaceNewLines(FormatOps.NormalizeNewLines(
                                                           Command))));
            }

            if (empty || !String.IsNullOrEmpty(Result))
            {
                list.Add("Result", FormatOps.DisplayString(
                             FormatOps.ReplaceNewLines(FormatOps.NormalizeNewLines(
                                                           Result))));
            }

            QueueList <string, string> queue = Queue;

            if (empty || ((queue != null) && (queue.Count > 0)))
            {
                list.Add("Queue", (queue != null) ?
                         queue.Count.ToString() : FormatOps.DisplayNull);
            }

            StringList callbackArguments = CallbackArguments;

            if (empty || ((callbackArguments != null) &&
                          (callbackArguments.Count > 0)))
            {
                list.Add("CallbackArguments", (callbackArguments != null) ?
                         callbackArguments.ToString() : FormatOps.DisplayNull);
            }

            if (interpreter != null)
            {
                interpreter.GetHostDebuggerInfo(ref list, detailFlags);
            }
            else if (empty)
            {
                list.Add((IPair <string>)null);
                list.Add("Interpreter");
                list.Add((IPair <string>)null);
                list.Add("Id", FormatOps.DisplayNull);
            }
        }