[m-dev.] for review: add mdb support for interactive queries

Peter Schachte schachte at cs.mu.OZ.AU
Mon Mar 15 12:30:30 AEDT 1999


On Sat, Mar 13, 1999 at 09:37:45PM +1100, Fergus Henderson wrote:
> On 11-Mar-1999, Peter Schachte <schachte at cs.mu.OZ.AU> wrote:
> > When you're debugging a particular module, however, you are probably
> > not interested in any modules other than the one you're debugging, the
> > ones it imports, the ones they import, and so on. For such cases, it
> > would be useful to focus on a particular module, and thereby limit
> > visibility to modules recursively imported by the focus module.
> > 
> > How does that model sound?
> 
> Imports in Mercury are never transitive (well, modulo compiler bugs).
> So I prefer to just include the directly-imported modules.

This transitive import is really just a generalization of the model
that all modules linked into the system are visible.  If you pick the
root module of the system as the current focus, then "all modules
transitively imported by the focus module" is the same as all modules
linked in.

This model seems much more consistent to me than the model that in the
default situation, all modules are visible, but when you set a focus
module, only those directly imported are visible.

The argument for using transitive imports in the debugger is just for
convenience.  When debugging, one often finds one must piece together
a goal from many modules and different levels of the system.  In such
situations one really wants a looser visibility system than one would
want when programming.


>   module	[<main-module> [<imported-modules list>]]
>   import_module	<imported-modules list>
>   use_module 	<used-modules list>
> 
>     The `module' command sets the focus module and resets the imported-modules
>     list.  The `import_module' and `use_module' commands add modules to the
>     lists of imported and used modules.

This seems a bit inconsistent naming-wise.  It's also a bit clumsy
when you want to remove a pesky import that keeps causing clashes:
you have to reset the imports and add back all the other modules.
Maybe allow individual module names preceded by + or - to specify
adding or removing modules from the current list?

>   query    	[<main-module> [<imported-modules list>]]
>   cc_query 	[<main-module> [<imported-modules list>]]
>   io_query 	[<main-module> [<imported-modules list>]]

Where are the actual queries specified?

> In debug grade, there ought to be a default main/2 which just invokes
> the debugger.

Very nice.

> Then it would be nice to have
> 
>   load		<shared-lib>
>   unload	<shared-lib>
> 
>     These would dynamically (re)load or unload a shared library.

I don't understand when you would want to use these.  Can you give a
bit more description or an example?


-- 
Peter Schachte                     We hang the petty thieves and appoint the
mailto:schachte at cs.mu.OZ.AU        great ones to public office.
http://www.cs.mu.oz.au/~schachte/      -- Aesop 
PGP: finger schachte at 128.250.37.3  



More information about the developers mailing list