Пример #1
0
    /**
     * Get entries from console starting on entry id @a fromId and add it into @a items.
     * @param items List of readed console items.
     * @param fromId Start reading from this id.
     * @return Number of readed entries.
     */
    public int GetEntries(LinkedList <DebugConsoleItem> items, int fromId)
    {
        _startGettingEntriesMethod.Invoke(null, null);

        int cnt       = EntriesCount();
        int readedCnt = 0;

        for (int i = fromId; i < cnt; ++i, ++readedCnt)
        {
            _getEntryInternalParams[0] = i;
            object entry = _getEntryInternalMethod.Invoke(null, _getEntryInternalParams);
            if (entry != null)
            {
                object unityEntry           = _getEntryInternalParams[1];
                string condition            = _conditionField.GetValue(unityEntry) as string;
                int    instanceId           = (int)_instanceIdField.GetValue(unityEntry);
                string fileName             = _fileField.GetValue(unityEntry) as string;
                int    line                 = (int)_lineField.GetValue(unityEntry);
                UnityEngine.LogType logType = LogTypeFromEntryType((int)_modeField.GetValue(unityEntry));
                DebugConsoleItem    item    = new DebugConsoleItem(condition, instanceId, logType, fileName, line);

                items.AddLast(item);
            }
        }

        _endGettingEntriesMethod.Invoke(null, null);

        return(readedCnt);
    }
Пример #2
0
 public void OpenStackFrame(DebugConsoleItem cacheItem, int line, bool tryResolveDebugStack)
 {
     string[] stackFrames = cacheItem.Stack.Split('\n');
     OpenFileOnFirstStackFrame(new List <string> {
         stackFrames[line]
     }, tryResolveDebugStack, null, 0);
 }
Пример #3
0
 private bool IsCoroutineStack(DebugConsoleItem item)
 {
     return item.Text.Contains(Picus.Sys.Coroutine.ManagerCrtn.CoroutineStackDebugId);
 }
Пример #4
0
 public void OpenStackFrame(DebugConsoleItem cacheItem, int line, bool tryResolveDebugStack)
 {
     string[] stackFrames = cacheItem.Stack.Split('\n');
     OpenFileOnFirstStackFrame(new List<string> { stackFrames[line] }, tryResolveDebugStack, null, 0);
 }
Пример #5
0
 public void OpenStack(DebugConsoleItem cacheItem, bool tryResolveDebugStack)
 {
     List<string> stackFrames = StackFrames(cacheItem.Text, cacheItem.Stack, tryResolveDebugStack);
     OpenFileOnFirstStackFrame(stackFrames, tryResolveDebugStack, cacheItem.DefaultFileName, cacheItem.DefaultLine);
 }
Пример #6
0
 private bool IsCoroutineStack(DebugConsoleItem item)
 {
     return(item.Text.Contains(Picus.Sys.Coroutine.ManagerCrtn.CoroutineStackDebugId));
 }
Пример #7
0
    public void OpenStack(DebugConsoleItem cacheItem, bool tryResolveDebugStack)
    {
        List <string> stackFrames = StackFrames(cacheItem.Text, cacheItem.Stack, tryResolveDebugStack);

        OpenFileOnFirstStackFrame(stackFrames, tryResolveDebugStack, cacheItem.DefaultFileName, cacheItem.DefaultLine);
    }
Пример #8
0
    /**
     * Get entries from console starting on entry id @a fromId and add it into @a items.
     * @param items List of readed console items.
     * @param fromId Start reading from this id.
     * @return Number of readed entries.
     */
    public int GetEntries(LinkedList<DebugConsoleItem> items, int fromId)
    {
        _startGettingEntriesMethod.Invoke(null, null);

        int cnt = EntriesCount();
        int readedCnt = 0;

        for (int i = fromId; i < cnt; ++i, ++readedCnt)
        {
            _getEntryInternalParams[0] = i;
            object entry = _getEntryInternalMethod.Invoke(null, _getEntryInternalParams);
            if (entry != null)
            {
                object unityEntry = _getEntryInternalParams[1];
                string condition = _conditionField.GetValue(unityEntry) as string;
                int instanceId = (int)_instanceIdField.GetValue(unityEntry);
                string fileName = _fileField.GetValue(unityEntry) as string;
                int line = (int)_lineField.GetValue(unityEntry);
                UnityEngine.LogType logType = LogTypeFromEntryType((int)_modeField.GetValue(unityEntry));
                DebugConsoleItem item = new DebugConsoleItem(condition, instanceId, logType, fileName, line);

                items.AddLast(item);
            }
        }

        _endGettingEntriesMethod.Invoke(null, null);

        return readedCnt;
    }