Debugging is performed using the facilities of the prog device bound to the local /prog directory (see prog(3)). Debugging of code running on a remote machine can be performed by binding the remote /prog directory in place of the local one. (See bind(1)).
In order to display source code and set breakpoints accurately, an up to date symbol file (.sbl) must be available as well as the limbo source file (.b).
Breakpoint positions are shown by red text in the source code display. Clicking on a breakpoint number in the Break panel results in the source code panel being scrolled or updated to show the breakpoint. Breakpoints are toggled by clicking on the statement or sub-expression in the source code window and clicking the breakpoint button on the icon bar. A breakpoint can be hit by any of the threads being debugged - breakpoints are set on source code, not on individual threads.
Clicking on a PID in the Threads panel results in the source code panel being scrolled or updated to highlight where in the code the thread is blocked, broken or halted on a breakpoint.
A running thread can be halted by clicking the stop button on the icon bar. A thread will also halt when it hits a breakpoint. Once a thread is halted (not blocked or broken) its execution can be advanced a step at a time by means of the buttons on the icon bar. The thread can be stepped one operation at a time or a statement at a time. Normally when single stepping, function calls are stepped into. Stepping commands allow for stepping over function calls, whereby the function is still called but its whole execution is treated as a single step. Stepping out of a function is also provided, whereby execution continues unabated until returning from the function. Execution of the halted thread can be continued, running until it terminates, breaks or hits another breakpoint.
Any of the threads being debugged can be killed or detached from the debugger using buttons on the icon bar. Detaching a halted thread resumes its execution.
The main window provides a set of menus for viewing source files, attaching to other threads, setting debugger options and searching for text in the source code window.
The stack window shows the full stack trace of the current thread. The stack trace is displayed as a list of frames, the current frame displayed at the top of the window. Each frame is given by the function name and source location of the code being executed in the frame. Each frame has the following sub-items:
Clicking on the name of a variable or function argument highlights the declaration of that name in the source panel of the main debug window. Clicking on the function name of a stack frame causes the main window source panel to display the current statement of the frame.
The debugger has a stack button which simply brings that window to the front of the display.
The options menu has a layout configuration which allows the user to have a horizontal scroll bar or to wrap long lines (the default); and an option to strip carriage return characters that precede newlines (for the benefit of those using Windows' editors). The state of the options is saved in the file /usr/username/lib/deb if that file can be created. The debugger attempts to read this file on startup to set the user's preferred options.
When setting breakpoints there is no visual cue for the selected statement or operation until the breakpoint is actually set.
It is only possible to debug modules executed by the interpreter. Code that has been JITed, the compilation execution method, yields stack information that does not correspond to information in the symbol (.sbl) file.
|DEB(1 )||Rev: Thu Feb 15 14:42:47 GMT 2007|