Debugger

This module provides access to the functionality offered by the MonetDB debugger and interpreter status. It is primarily used in interactive sessions to activate the debugger at a given point. Furthermore, the instructions provide the necessary handle to generate information for post-mortum analysis.

To enable ease of debugging and performance monitoring, the MAL interpreter comes with a hardwired gdb-like text-based debugger. A limited set of instructions can be included in the programs themselves, but beware that debugging has a global effect. Any concurrent user will be affected by breakpoints being set.

The prime scheme to inspect the MAL interpreter status is to use the MAL debugger directly. However, in case of automatic exception handling it helps to be able to obtain BAT versions of the critical information, such as stack frame table, stack trace, and the instruction(s) where an exception occurred. The inspection typically occurs in the exception handling part of the MAL block.

Beware, a large class of internal errors can not easily captured this way. For example, bus-errors and segmentation faults lead to premature termination of the process. Similar, creation of the post-mortum information may fail due to an inconsistent state or insufficient resources.

MODULE mdb;

PATTERN mdb.List(X_0:str, X_1:str):void;
COMMENT "";

PATTERN mdb.List():void;
COMMENT "";

PATTERN mdb.dump():void;
COMMENT "";

COMMAND mdb.getContext(X_0:str):str;
COMMENT "";

PATTERN mdb.getDebug():int;
COMMENT "";

PATTERN mdb.getDebugFlags() (X_0:bat[:str], X_1:bat[:bit]);
COMMENT "";

PATTERN mdb.getDefinition():bat[:str];
COMMENT "";

COMMAND mdb.getException(X_0:str):str;
COMMENT "";

COMMAND mdb.getReason(X_0:str):str;
COMMENT "";

PATTERN mdb.getStackDepth():int;
COMMENT "";

PATTERN mdb.getStackFrame() (X_0:bat[:str], X_1:bat[:str]);
COMMENT "";

PATTERN mdb.getStackFrame(X_0:int) (X_1:bat[:str], X_2:bat[:str]);
COMMENT "";

PATTERN mdb.getStackTrace() (X_0:bat[:int], X_1:bat[:str]);
COMMENT "";

PATTERN mdb.getVMsize():lng;
COMMENT "";

PATTERN mdb.inspect(X_0:str, X_1:str):void;
COMMENT "";

PATTERN mdb.list(X_0:str, X_1:str):void;
COMMENT "";

PATTERN mdb.list():void;
COMMENT "";

PATTERN mdb.listMapi():void;
COMMENT "";

COMMAND mdb.modules():bat[:str];
COMMENT "";

PATTERN mdb.setCatch(X_0:bit):void;
COMMENT "";

PATTERN mdb.setDebug(X_0:int):int;
COMMENT "";

PATTERN mdb.setDebug(X_0:str):int;
COMMENT "";

PATTERN mdb.setTrace(X_0:bit):void;
COMMENT "";

PATTERN mdb.setTrace(X_0:str):void;
COMMENT "";

PATTERN mdb.setVMsize(X_0:lng):lng;
COMMENT "";

PATTERN mdb.start():void;
COMMENT "";

PATTERN mdb.start(X_0:int):void;
COMMENT "";

PATTERN mdb.start(X_0:str, X_1:str):void;
COMMENT "";

PATTERN mdb.stop():void;
COMMENT "";

PATTERN mdb.var(X_0:str, X_1:str):void;
COMMENT "";

PATTERN mdb.var():void;
COMMENT "";