예제 #1
0
		private void Manager_OnMouseHover(ScintillaControl sci, Int32 position)
		{
			DebuggerManager debugManager = PluginMain.debugManager;
			FlashInterface flashInterface = debugManager.FlashInterface;

			if (!PluginBase.MainForm.EditorMenu.Visible && flashInterface != null &&
				flashInterface.isDebuggerStarted && flashInterface.isDebuggerSuspended)
			{
				if (debugManager.CurrentLocation != null &&
					debugManager.CurrentLocation.File != null)
				{
					String localPath = debugManager.GetLocalPath(debugManager.CurrentLocation.File);

					if (localPath == null || localPath != PluginBase.MainForm.CurrentDocument.FileName)
					{
						return;
					}
				}
				else
				{
					return;
				}

				Point dataTipPoint = Control.MousePosition;
				Rectangle rect = new Rectangle(m_ToolTip.Location, m_ToolTip.Size);

				if (m_ToolTip.Visible && rect.Contains(dataTipPoint))
				{
					return;
				}

				position = sci.WordEndPosition(position, true);
				String leftword = GetWordAtPosition(sci, position);
				if (leftword != String.Empty)
				{
					try
					{
						ASTBuilder builder = new ASTBuilder(true);

						ValueExp exp = builder.parse(new System.IO.StringReader(leftword));
						ExpressionContext context = new ExpressionContext(flashInterface.Session);

						context.Depth = debugManager.CurrentFrame;

						Object obj = exp.evaluate(context);

						Show(dataTipPoint, (Variable)obj);
					}
					catch (Exception e)
					{
					}
				}
			}
		}
예제 #2
0
		public Boolean ShouldBreak(SourceFile file, int line)
		{
			String localPath = PluginMain.debugManager.GetLocalPath(file);

			if (localPath == null)
			{
				return false;
			}

			if (m_TemporaryBreakPointInfo != null)
			{
				if (m_TemporaryBreakPointInfo.FileFullPath == localPath &&
					m_TemporaryBreakPointInfo.Line == (line - 1))
				{
					m_TemporaryBreakPointInfo.IsDeleted = true;

					List<BreakPointInfo> bpList = new List<BreakPointInfo>();
					bpList.Add(m_TemporaryBreakPointInfo);

					PluginMain.debugManager.FlashInterface.UpdateBreakpoints(bpList);

					m_TemporaryBreakPointInfo = null;

					return true;
				}
			}

			int index = GetBreakPointIndex(localPath, line - 1);

			if (index >= 0)
			{
				BreakPointInfo bpInfo = m_BreakPointList[index];

				if (bpInfo.ParsedExpression != null)
				{
					ExpressionContext context = new ExpressionContext(PluginMain.debugManager.FlashInterface.Session);

					try
					{
						object val = bpInfo.ParsedExpression.evaluate(context);

						if (val is Boolean)
						{
							return (Boolean)val;
						}
						else if (val is Int32)
						{
							return (Int32)val != 0;
						}
					}
					catch (ExpressionException e)
					{
						MessageBox.Show(e.getLocalizedMessage(), PluginCore.Localization.TextHelper.GetString("FlashDevelop.Title.ErrorDialog"));
						return true;
					}
				}
				else
				{
					return true;
				}
			}

			return false;
		}
예제 #3
0
		// create a new context object by combinging the current one and o 
		public virtual Context createContext(Object o)
		{
			ExpressionContext c = new ExpressionContext(m_session);
			c.Context = o;
			c.createPseudoVariables(m_createIfMissing);
			c.m_namedPath.AddRange(m_namedPath);
			return c;
		}