Check out the new USENIX Web site. next up previous
Next: Summary Up: Object Oriented Design Previous: Devices as Objects

The Debugger

Some targets have sufficient I/O capabilities to support an interface to a debugger, so uCR provides the GDB class. A GDB object is an interface to a suitably modified version of the GNU Debugger GDB that runs on a host computer.

The GDB class is a concrete class that takes in its constructor a pointer to a suitable device class for use as the communication channel with the host. Once created, the debugger does not become available to the host until its ``go()'' method is called, generally by a special thread. This method never returns and forever communicates with the host, receiving and processing requests for action, memory, etc.

The uCR core leaves things like breakpoint traps and faults available to the programmer, so the GDB class uses standard interfaces to gain access to threads and the faults they make. The debugger runs in a thread of its own, so can be said to be an active object. As an active object, it is free to manipulate other threads, stop them, run them, examine memory, etc.

It turns out that not much of what the proxy needs to do is CPU specific, and other then actual I/O that communicates with the hosts, none of it involves board details. Many of the details of the target CPU are managed by the host GBD program, leaving only some CPU specific cache management and fault handling for the GDB class to cope with.



Stephen Williams
Sun May 4 15:28:26 PDT 1997