Next: , Previous: Help commands, Up: Debugger commands   [Contents][Index]


7.10.9 Declarative debugging mdb commands


The following commands relate to the declarative debugger. See Declarative debugging for details.


dd [-r] [-R] [-nnodes] [-ssearch-mode] [-ppassfile] [-ffailfile]

Starts declarative debugging using the current event as the initial symptom.


When searching for bugs the declarative debugger needs to keep portions of the execution trace in memory. If it requires a new portion of the trace then it needs to rerun the program. The ‘-nnodes’ or ‘--nodes nodes’ option tells the declarative debugger how much of the execution trace to gather when it reruns the program. A higher value for nodes requires more memory, but improves the performance of the declarative debugger for long running programs since it will not have to rerun the program as often.


The ‘-ssearch-mode’ or ‘--search-mode search-mode’ option tells the declarative debugger which search mode to use. Valid search modes are ‘top_down’ (or ‘td’), ‘divide_and_query’ (or ‘dq’) and ‘suspicion_divide_and_query’ (or ‘sdq’). ‘top_down’ is the default when this option is not given.


Use the ‘-r’ or ‘--resume’ option to continue your previous declarative debugging session. If the ‘--resume’ option is given and there were no previous declarative debugging sessions then the option will be ignored. A ‘dd --resume’ command can be issued at any event. The ‘--search-mode’ option may be used with the ‘--resume’ option to change the search mode of a previously started declarative debugging session.


Use the ‘-R’ or ‘--reset-knowledge-base’ option to reset the declarative debugger’s knowledge base. The declarative debugger will forget any previous answers that have been supplied. It will ask previous questions again if it needs to. This option does not affect what predicates or modules are trusted.


The arguments supplied to the ‘--pass-trace-counts’ (or ‘-p’) and ‘--fail-trace-counts’ (or ‘-f’) options are either trace count files or files containing a list of trace count files. The supplied trace counts are used to assign a suspicion to each event based on which parts of program were executed in the failing test case(s), but not the passing test case(s). This is used to guide the declarative debugger when the suspicion-divide-and-query search mode is used. If the suspicion-divide-and-query search mode is specified then either both the ‘-p’ and ‘-f’ options must be given, or the ‘fail_trace_counts’ and ‘pass_trace_counts’ configuration parameters must be set (using the ‘set’ command).

trust module-name|proc-spec

Tells the declarative debugger to trust the given module, predicate or function.


Individual predicates or functions can be trusted by just giving the predicate or function name. If there is more than one predicate or function with the given name then a list of alternatives will be shown.


The entire Mercury standard library is trusted by default and can be untrusted in the usual manner using the ‘untrust’ command. To restore trusted status to the Mercury standard library issue the command ‘trust standard library’ or just ‘trust std lib’.


See also ‘trusted’ and ‘untrust’.


trusted

Lists all the trusted modules, predicates and functions. See also ‘trust’ and ‘untrust’.


untrust num

Removes the object from the list of trusted objects. num should correspond with the number shown in the list produced by issuing a ‘trusted’ command. See also ‘trust’ and ‘trusted’.



Next: , Previous: Help commands, Up: Debugger commands   [Contents][Index]