Beispiel #1
0
		private async Task UpdateRuntimeInfo(OracleRuntimeInfo runtimeInfo, CancellationToken cancellationToken)
		{
			_runtimeInfo = runtimeInfo;
			_runtimeInfo.Trace();

			if (_runtimeInfo.IsTerminated == true)
			{
				return;
			}

			var stackTrace = await GetStackTrace(cancellationToken);
			_stackTrace.Clear();

			foreach (var item in stackTrace.Items)
			{
				var isAnonymousBlock = String.IsNullOrEmpty(item.Name);
				var objectIdentifier = OracleObjectIdentifier.Create(item.Owner, item.Name);
				var objectName = isAnonymousBlock
					? PlSqlBlockTitle
					: $"{item.Owner}.{item.Name}";

				string programText;
				if (!_sources.TryGetValue(objectName, out programText))
				//{
				//	if (isAnonymousBlock && stackTrace.Items[0] != item)
				//	{
				//		var anonymousPlSqlSources = await GetAnonymousPlSqlSources(cancellationToken);
				//		anonymousPlSqlSources = anonymousPlSqlSources.Trim();
				//		foreach (var kvp in _sources)
				//		{
				//			if (String.Equals(kvp.Value, anonymousPlSqlSources))
				//			{
				//				objectName = kvp.Key;
				//				programText = kvp.Value;
				//				break;
				//			}
				//		}

				//		if (String.Equals(objectName, PlSqlBlockTitle))
				//		{
				//			objectName = $"dynamic PL/SQL block #{dynamicSqlBlockCounter++}";
				//			_sources.Add(objectName, anonymousPlSqlSources);
				//		}
				//	}
				//}
				//else
				{
					programText = await GetSources(item, cancellationToken);
					_sources.Add(objectName, programText);
				}

				var debugProgramItem =
					new DebugProgramItem
					{
						Header = objectName,
						ProgramText = programText,
						Line = item.Line,
						ProgramIdentifier = objectIdentifier
					};

				_stackTrace.Add(debugProgramItem);
			}
		}
Beispiel #2
0
        private async Task UpdateRuntimeInfo(OracleRuntimeInfo runtimeInfo, CancellationToken cancellationToken)
        {
            _runtimeInfo = runtimeInfo;
            _runtimeInfo.Trace();

            if (_runtimeInfo.IsTerminated == true)
            {
                return;
            }

            var stackTrace = await GetStackTrace(cancellationToken);

            _stackTrace.Clear();

            foreach (var item in stackTrace.Items)
            {
                var isAnonymousBlock = String.IsNullOrEmpty(item.Name);
                var objectIdentifier = OracleObjectIdentifier.Create(item.Owner, item.Name);
                var objectName       = isAnonymousBlock
                                        ? PlSqlBlockTitle
                                        : $"{item.Owner}.{item.Name}";

                if (!_sources.TryGetValue(objectName, out string programText))
                //{
                //	if (isAnonymousBlock && stackTrace.Items[0] != item)
                //	{
                //		var anonymousPlSqlSources = await GetAnonymousPlSqlSources(cancellationToken);
                //		anonymousPlSqlSources = anonymousPlSqlSources.Trim();
                //		foreach (var kvp in _sources)
                //		{
                //			if (String.Equals(kvp.Value, anonymousPlSqlSources))
                //			{
                //				objectName = kvp.Key;
                //				programText = kvp.Value;
                //				break;
                //			}
                //		}

                //		if (String.Equals(objectName, PlSqlBlockTitle))
                //		{
                //			objectName = $"dynamic PL/SQL block #{dynamicSqlBlockCounter++}";
                //			_sources.Add(objectName, anonymousPlSqlSources);
                //		}
                //	}
                //}
                //else
                {
                    programText = await GetSources(item, cancellationToken);

                    _sources.Add(objectName, programText);
                }

                var debugProgramItem =
                    new DebugProgramItem
                {
                    Header            = objectName,
                    ProgramText       = programText,
                    Line              = item.Line,
                    ProgramIdentifier = objectIdentifier
                };

                _stackTrace.Add(debugProgramItem);
            }
        }