Exemple #1
0
 private static void RemoveBreakpoint(NuGenFunctionBreakpointInformation functionBreakpoint)
 {
     functionBreakpoint.State = BreakpointState.Removed;
     NuGenUIHandler.Instance.UpdateBreakpoint(functionBreakpoint.MethodDefinition, functionBreakpoint);
     NuGenProject.Instance.FunctionBreakpoints.Remove(functionBreakpoint);
     NuGenProject.Instance.IsSaved = false;
 }
Exemple #2
0
        public void UpdateBreakpoint(NuGenBreakpointInformation breakpointInformation)
        {
            NuGenFunctionBreakpointInformation functionBreakpointInformation = breakpointInformation as NuGenFunctionBreakpointInformation;

            if (!Window.IsDisposed && Window.Visible && functionBreakpointInformation != null)
            {
                Window.UpdateBreakpoint(functionBreakpointInformation);
            }
        }
Exemple #3
0
        private void RowDelete(GridEXRow row)
        {
            NuGenFunctionBreakpointInformation functionBreakpoint = NuGenHelperFunctions.TaggedObjects[(String)row.Cells[1].Value + (String)row.Cells[2].Value] as NuGenFunctionBreakpointInformation;

            if (functionBreakpoint != null)
            {
                RemoveBreakpoint(functionBreakpoint);
            }

            NuGenHelperFunctions.TaggedObjects.Remove((String)row.Cells[1].Value + (String)row.Cells[2].Value);
        }
Exemple #4
0
        private void RemoveBreakpointMenuItem_Click(object sender, EventArgs e)
        {
            if (breakpointsGrid.SelectedItems.Count == 1)
            {
                GridEXRow row = breakpointsGrid.SelectedItems[0].GetRow();
                NuGenFunctionBreakpointInformation functionBreakpoint = NuGenHelperFunctions.TaggedObjects[(String)row.Cells[1].Value + (String)row.Cells[2].Value] as NuGenFunctionBreakpointInformation;

                if (functionBreakpoint != null)
                {
                    RowDelete(breakpointsGrid.SelectedItems[0].GetRow());
                    breakpointsGrid.SelectedItems[0].GetRow().Delete();
                }
            }
        }
Exemple #5
0
        private void DeactivateBreakpointMenuItem_Click(object sender, EventArgs e)
        {
            if (breakpointsGrid.SelectedItems.Count == 1)
            {
                GridEXRow row = breakpointsGrid.SelectedItems[0].GetRow();
                NuGenFunctionBreakpointInformation functionBreakpoint = NuGenHelperFunctions.TaggedObjects[(String)row.Cells[1].Value + (String)row.Cells[2].Value] as NuGenFunctionBreakpointInformation;

                if (functionBreakpoint != null)
                {
                    DeactivateBreakpoint(functionBreakpoint);
                    NuGenUIHandler.Instance.UpdateBreakpoint(functionBreakpoint.MethodDefinition, functionBreakpoint);
                }
            }
        }
Exemple #6
0
        public void UpdateBreakpoint(NuGenFunctionBreakpointInformation breakpoint)
        {
            DisableRedraw();
            int selectionStart  = SelectionStart;
            int selectionLength = SelectionLength;

            RefreshBreakpoint(breakpoint);

            SelectionStart  = selectionStart;
            SelectionLength = selectionLength;

            EnableRedraw();
            Refresh();
        }
Exemple #7
0
        public bool HasBreakpointsInMethod(NuGenMethodDefinition methodDefinition)
        {
            bool result = false;
            int  index  = 0;

            while (!result && index < FunctionBreakpoints.Count)
            {
                NuGenFunctionBreakpointInformation functionBreakpoint = FunctionBreakpoints[index++];

                if (functionBreakpoint.MethodDefinition == methodDefinition)
                {
                    result = true;
                }
            }

            return(result);
        }
Exemple #8
0
        public NuGenFunctionBreakpointInformation FindFunctionBreakpoint(NuGenMethodDefinition methodDefinition, uint offset)
        {
            NuGenFunctionBreakpointInformation result = null;
            int index = 0;

            while (result == null && index < NuGenProject.Instance.FunctionBreakpoints.Count)
            {
                NuGenFunctionBreakpointInformation functionBreakpoint = NuGenProject.Instance.FunctionBreakpoints[index++];

                if (functionBreakpoint.MethodDefinition == methodDefinition && functionBreakpoint.Offset == offset)
                {
                    result = functionBreakpoint;
                }
            }

            return(result);
        }
Exemple #9
0
        private void RefreshBreakpoint(NuGenFunctionBreakpointInformation breakpoint)
        {
            if (CurrentLine == null || breakpoint.Offset != CurrentLine.InstructionOffset)
            {
                int breakpointOffset = Convert.ToInt32(breakpoint.Offset);
                NuGenBreakpointLine breakpointLine = new NuGenBreakpointLine(breakpoint.State, breakpointOffset);
                string          line;
                NuGenBaseILCode ilCode;

                int position = FindPositionOfILCodeByOffset(breakpointOffset, out line, out ilCode);

                if (ilCode != null)
                {
                    SetLineColor(position, line, ilCode.Indentation, breakpointLine);
                }
            }
        }
Exemple #10
0
        public void RemoveAssemblyRelatedBreakpoints(NuGenAssembly assembly)
        {
            int index = 0;

            while (index < FunctionBreakpoints.Count)
            {
                NuGenFunctionBreakpointInformation breakpoint = FunctionBreakpoints[index];

                if (breakpoint.MethodDefinition.BaseTypeDefinition.ModuleScope.Assembly == assembly)
                {
                    breakpoint.Remove();
                    FunctionBreakpoints.Remove(breakpoint);
                    NuGenUIHandler.Instance.RemoveBreakpoint(breakpoint);
                }
                else
                {
                    index++;
                }
            }
        }
Exemple #11
0
        public void SetBreakpointAtSelection()
        {
            NuGenMethodDefinition methodDefinition = CodeObject as NuGenMethodDefinition;

            if (methodDefinition != null)
            {
                NuGenBaseILCode ilCode = FindILCodeByIndex(SelectionStart);

                if (ilCode != null)
                {
                    NuGenFunctionBreakpointInformation breakpointInformation = NuGenBreakpointHandler.Instance.AddRemoveBreakpoint(methodDefinition, ilCode.Offset, false);

                    if (breakpointInformation != null)
                    {
                        UpdateBreakpoint(breakpointInformation);
                        NuGenProject.Instance.IsSaved = false;
                    }
                }
            }
        }
Exemple #12
0
        private void AssociateBreakpointsWithMethods()
        {
            if (FunctionBreakpoints != null && FunctionBreakpoints.Count > 0 && Assemblies != null)
            {
                if (Assemblies.Count > 0)
                {
                    int index = 0;

                    while (index < FunctionBreakpoints.Count)
                    {
                        NuGenFunctionBreakpointInformation functionBreakpoint = FunctionBreakpoints[index];

                        if (functionBreakpoint.AssociateWithMethod())
                        {
                            index++;
                        }
                        else
                        {
                            FunctionBreakpoints.Remove(functionBreakpoint);
                        }
                    }
                }
                else
                {
                    FunctionBreakpoints.Clear();
                }
            }

            if (RunToCursorBreakpoint != null)
            {
                if (!RunToCursorBreakpoint.AssociateWithMethod())
                {
                    RunToCursorBreakpoint.Remove();
                    RunToCursorBreakpoint = null;
                }
            }
        }
		private void RefreshBreakpoint(NuGenFunctionBreakpointInformation breakpoint)
		{
			if (CurrentLine == null || breakpoint.Offset != CurrentLine.InstructionOffset)
			{
				int breakpointOffset = Convert.ToInt32(breakpoint.Offset);
				NuGenBreakpointLine breakpointLine = new NuGenBreakpointLine(breakpoint.State, breakpointOffset);
				string line;
				NuGenBaseILCode ilCode;

				int position = FindPositionOfILCodeByOffset(breakpointOffset, out line, out ilCode);

				if (ilCode != null)
				{
					SetLineColor(position, line, ilCode.Indentation, breakpointLine);
				}
			}
		}
Exemple #14
0
 public void UpdateBreakpoint(NuGenFunctionBreakpointInformation breakpoint)
 {
     ilEditor.UpdateBreakpoint(breakpoint);
 }
 private static void RemoveBreakpoint(NuGenFunctionBreakpointInformation functionBreakpoint)
 {
     functionBreakpoint.State = BreakpointState.Removed;
     NuGenUIHandler.Instance.UpdateBreakpoint(functionBreakpoint.MethodDefinition, functionBreakpoint);
     NuGenProject.Instance.FunctionBreakpoints.Remove(functionBreakpoint);
     NuGenProject.Instance.IsSaved = false;
 }
		public void UpdateBreakpoint(NuGenFunctionBreakpointInformation breakpoint)
		{
			ilEditor.UpdateBreakpoint(breakpoint);
		}
		public void UpdateBreakpoint(NuGenFunctionBreakpointInformation breakpoint)
		{
			DisableRedraw();
			int selectionStart = SelectionStart;
			int selectionLength = SelectionLength;

			RefreshBreakpoint(breakpoint);

			SelectionStart = selectionStart;
			SelectionLength = selectionLength;

			EnableRedraw();
			Refresh();
		}