[m-dev.] For review interactive queries for the external debugger
Fergus Henderson
fjh at cs.mu.OZ.AU
Thu Apr 22 03:57:17 AEST 1999
On 21-Apr-1999, Erwan Jahier <Erwan.Jahier at irisa.fr> wrote:
>
> This change allows interactive queries to be typed from the external debugger.
...
> +++ debugger_interface.m 1999/04/21 14:48:50
> +:- pred get_list_modules_to_import(debugger_request, int, imports).
> +:- mode get_list_modules_to_import(in, out, out) is det.
> +
> +:- pragma export(get_list_modules_to_import(in, out, out),
> + "ML_DI_get_list_modules_to_import").
> +
> +get_list_modules_to_import(DebuggerRequest, CardList, ModulesList) :-
> + (
> + DebuggerRequest = query(List)
> + ->
> + ModulesList = List,
> + length(ModulesList, CardList)
> + ;
> + DebuggerRequest = cc_query(List)
> + ->
> + ModulesList = List,
> + length(ModulesList, CardList)
> + ;
> + DebuggerRequest = io_query(List)
> + ->
> + ModulesList = List,
> + length(ModulesList, CardList)
> + ;
> + error("get_list_modules_to_import: not a query request")
> + ).
You might as well put the call to length/2 outside of the if-then-else.
I think `ListLength' would be a better name than `CardList'.
> +++ mercury_trace_external.c 1999/04/21 14:48:57
...
> + MR_REQUEST_MMC_OPTIONS = 16 /* import modules for interactive
> + queries */
That comment is wrong.
> +static void MR_get_list_modules_to_import(Word debugger_request,
> + Integer *modules_list_card_ptr, Word *modules_list_ptr);
Here again I suggest s/card/length/
> @@ -375,7 +388,16 @@
> MR_Trace_Port port = event_info->MR_trace_port;
> const char *path = event_info->MR_event_path;
> Word *saved_regs = event_info->MR_saved_regs;
> + Integer modules_list_card;
> + Word modules_list;
Likewise.
> % File : interactive_queries.op
...
> The list of module names passed downed in argument of the query specify which \
s/downed in/down in the/
> modules will be imported. Note that you can also add new modules to the list \
> of imports directly at the query prompt, by using a command of the form \
> `[\"module\"]', e.g. `[\"int\"]'. You need to import all the modules that \
Delete the double-quotes here, I think.
Most of this documentation is duplicated from the documentation
in doc/user_guide.texi; I think you should add a comment to both
places pointing this out, so that when we modify that documentation
in user_guide.texi we also remember to (tell Erwan to) modify
interactive_queries.op.
> opium_command(
> name : mmc_options,
> arg_list : [String],
> arg_type_list : [string],
> abbrev : _,
> interface : menu,
> command_type : opium,
> implementation : mmc_options_Op,
> parameters : [],
> message :
> "This command sets the options that will be passed to `mmc' to compile your \
> query when you use one of the query commands: `query/1', `cc_query/2', or \
> `io_query/3'. For example, if a query results in a compile error, it may \
> sometimes be helpful to use mmc_options(\"mmc_options --verbose-errors\").\
> "
Delete the second occurrence of `mmc_options' in that sentence.
Apart from those mostly minor issues, that change looks great.
I would like to see a relative diff after you've addressed the
above issues.
Cheers,
Fergus.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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