The IDebugger interface

Overview

At the heart of nemiver is the IDebugger interface. It abstracts away the underlying debugger engine, be it GDB or whatever engine we may use in the future.

IDebugger is designed around an asynchronous request passing paradigm. That means when a client code invokes a method on IDebugger to make it perform a given task on the program being debugged - like IDebugger::run() - the method returns immediately. When the request completes, IDebugger emits an event - a signal in gtk+ speak - to notify the world about the state of the completion.

One particularity of the IDebugger interface is that it integrates well with the glib mainloop. That means, events coming from the underlying debugger engine - GDB for instance - are queued to the glib mainloop, just as the events received from the graphical system like mouse motion, click, etc ... This is really important since it enables IDebugger to be implemented using mono treaded model and yet be used in a responsive gtk+ based GUI.

You can learn about the IDebugger interface by looking at its header file at https://git.gnome.org/browse/nemiver/tree/src/dbgengine/nmv-i-debugger.h

Usage pattern

To use the IDebugger interface in a program of yours you basically need to follow these steps:

  • load a module that implements the IDebugger interface, namely the "gdbengine" module.
  • get the IDebugger interface from the module
  • initialise the interface
  • connect to the IDebgger events you are interested in
  • now let the show begin.

There are example of how use the IDebugger interface in the nemiver source tree. For instance, you can look at how to write a little program that loads a core file and dumps its stack trace using IDebugger: https://git.gnome.org/browse/nemiver/tree/tests/test-core.cc

Apps/Nemiver/IDebugger (last edited 2016-08-27 19:53:06 by ChristianHergert)