Eclipse Guard

Guard-IDE

Architecture

Because the plug-in architecture and platforms for IDEs vary so significantly, we have designed the Guard-IDE to be as generic as possible. Figure 1 shows the architecture and identifies two main parts:

  • an IDE package which resides within the target IDE. This provides an implementation of the graphical user interface for managing assertions, and exposes important debugging interfaces in the IDE that are required by the Guard Interpreter;
  • the Guard package which is external to the IDE. This provides the core relative debugging functionality (including a sophisticated data driven execution engine), as well as necessary infrastructure for communication between the IDE and Guard.

The Guard package is actually built from original ClassicGuard components. It encapsulates Guard's core relative debugging functionality within a module called the Guard Interpreter. In Classic Guard, debug functions (such managing breakpoints, evaluating expressions, etc) are provided by a separate client-server based debugger, built on top of GDB. However, in Guard-IDE these debug interfaces are provided instead by the target IDE itself. This leverages the functions that are already available in the IDE, and allows us to support multiple languages in a way that is consistent with the basic IDE operation.

The Guard package and the specific IDE packages utilize different communications mechanisms depending on the available infrastructure. The Java based IDE, such as Eclipse, WebSphere and Netbeans all use Java Native Interface (JNI) as the communication infrastructure, however, VS.Net uses COM under Windows.

Guard package

The Guard package is external to IDE and provides relative debugging functionality by reusing the original components of ClassicGuard. Since Guard Interpreter is written in C, we implemented an interface layer as a wrapper on top of Guard Interpreter to interact with IDE package. The inter-process communication (JNI / COM)is used to facilitate calls out of the Guard Interpreter to the IDE package, such as those required to place breakpoints, perform expression evaluation, etc.

IDE package

The Eclipse IDE package is responsible for implementing Guard’s graphical user interface, and provides functions such as debugger control, setting breakpoints, receiving breakpoint events and expression evaluation. This package uses a model-view-controller (MVC) design pattern, and provides a generic interface that handles controlling and monitoring of relative debugging:

  • A generic high-level relative debug model that represents the assertions and comparison results.
  • Views that give user graphical visualization of the model's status and provide user interface to control relative debugging by transferring commands.
  • A controller that keeps the model updated by generating events based on the messages from the external Guard package.