[m-dev.] Suggestions for mdb

Erwan Jahier Erwan.Jahier at irisa.fr
Wed Aug 23 18:26:19 AEST 2000


| I have a few ideas for simple improvements to the debugger.
| 
| 1. Add a `save' command, or something similar, that dumps the
| current set of breakpoints and aliases to a local .mdbrc file.
| This would save me a fair bit of hassle when debugging.
| 
| 2. The print command, or some variant thereof, should act
| like `ls' in the browser - e.g. pretty printing to depth 5
| or whatever has been set in the browser.
| 
| 2b. Corollary: it would be nice to be able to set browser
| variables in the .mdbrc file.
| 
| 3. Allow multi-command aliases.  I would like to be able to
| set up an alias to, e.g., continue to the next break point then
| print out all the variables at that point.  Unfortunately,
| `alias cp c; p *' is seen as two separate commands.

In Morphine (1), you could (2) do it like that:

	cp :- c, p.

Not only you can define "multi-command aliases", but also you can define
arbitrary complex (Prolog) programs that extend the debugger to fit your needs.
Don't you like to hack you .emacs file? If so, you would certainly like to hack
a .morphine-rc file (and Prolog is certainly more intuitive than lisp for
Mercury users ;-). Well, actually, there are even support (3) to help people
extend the set of debugging commands more properly than just putting stuff in 
a configuration file.

The basic idea of Morphine is to have a clean separation (modularity) between
the runtime system and the debugging (or monitoring) tools. This has two main
advantages:
 * Any end-user can implement its own tools
 * debugging tools can be reused

The price to pay is sometimes the efficiency. But it is only seldomly the case,
and when it is, it is always possible to do it the mdb way from Morphine ; it 
is just more difficult to do by end-users in that case.

(1) http://www.irisa.fr/lande/download.html
(2) I say "could" because I have not put breakpoints in Morphine because I
believe that `fget/1' (4) makes them useless. It would be quite easy to reuse
the breakpoint architecture of mdb for Morphine though (As I have already done
for command such as `query', `browse', `retry', ... Well nearly all the mdb
commands except breakpoints actually).
(3) http://www.irisa.fr/lande/jahier/node7.html
    http://www.irisa.fr/lande/jahier/node8.html
(4) http://www.irisa.fr/lande/jahier/node12.html

-- 
R1.


--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list