Developer Information

This page contains useful information for those interested in either developing new plugins for CRDebug or modifying the existing codebase. Project TODO List is also located in here.

Software Used

We have used following software to develop and test CRDebug:

Plugins

CRDebug plugins are written in C# language and compiled into a C# Class Library DLL. When CRDebug starts up, it scans plugins directory, located under CRDebug main directory, for DLL files that contain a class implementing interface called IModule:

public interface IModule
{
    Panel Create(DataTable ds, VariableDefCollection vars);
    void Start();
    void Stop();
    void ProcessMessage(PluginMessage msg, object param);
    string GetHelpText();
}

To create a plugin for CRDebug in Visual Studio .NET, follow these steps:

Sample plugin:

// TestPlugin.cs
using System;
using System.Data;
using System.Drawing;
using System.Windows.Forms;

namespace CRDebug
{
	/// 
	/// Sample plugin
	/// 
	public class TestPlugin : IModule
	{
		private DataTable			  dataTable;
		private VariableDefCollection varDefs;

		public TestPlugin()
		{
		}

		#region Implementation of IModule
		public void Start()
		{
		}

		public string GetHelpText()
		{
			return "This is a sample plugin.";
		}

		public void ProcessMessage(PluginMessage msg, object param)
		{
		}

		public Panel Create(DataTable ds, VariableDefCollection vars)
		{
			TabPage panel = new TabPage("TestPlugin");
			Label   label = new Label();

			this.dataTable = ds;
			this.varDefs = vars;

			label.BackColor = Color.AliceBlue;
			label.Text = "Click me!";
			label.Location = new Point(0, 0);
			label.Size = new Size(panel.Size.Width, panel.Size.Height);
			label.Click += new EventHandler(OnLabelClicked);

			panel.Controls.Add(label);
			return panel;
		}

		public void Stop()
		{
		}
		#endregion

		/* Event handlers */
		public void OnLabelClicked(object sender, EventArgs ev)
		{
			MessageBox.Show("Hello world!", "Hello");
		}
	}
}

CRDebug TODO

  Description Module
gamut for the 2D view PlotterPlugin
draw positive direction arrows for the X/Y axis lines near the edges PlotterPlugin
basic curve fitting functionality PlotterPlugin
implement ODBC support to allow for captured data to be stored in/retrieved from a database DebuggerCore
display help text for the currently selected plugin in a dialog accessible from Help menu Main GUI
store user configuration in a disk file (ODBC connection strings, TCP/IP settings, capture buffer size etc.) DebuggerCore
when tables are manually deleted (dropped) from database, CRDTableInfo contents must be synchronized somehow DebuggerCore
display selected item frame number next to the item itself rather than in the status text on the top PlotterPlugin

Legend:
  TODO item
  working on it
  finished item