[m-rev.] for review:

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Jan 13 00:55:04 AEDT 2004


On 12-Jan-2004, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> +++ trace/mercury_trace_tables.c	9 Jan 2004 14:43:21 -0000
> @@ -24,18 +24,38 @@
>  #include <string.h>
>  #include <ctype.h>
>  
> +/*
> +** We record module layout structures in two tables. The MR_module_infos
> +** array contains one pointer to every module layout structure, and is ordered
> +** by the fully qualified module name. The MR_module_nickname array contains
> +** one reference to every module layout structure by the module's
> +** less-than-fully-qualified name (which we call `nickname' here),
> +** ordered by the nickname.

What about modules which have more than one nickname?
e.g. "a.b.c.d" has three nicknames: "b.c.d", "c.d" and "d".

The code seems to handle that case OK, but the comment doesn't.

> +** The exception is that names that are the nicknames
> +** of more than one module, the corresponding layout pointer will be NULL.

In the case of ambiguity, why not keep a list of all the matching module
layout pointers?  It may be possible to resolve the ambiguity later,
when a module name is used.  In particular, it should be possible for
MR_process_matching_procedures() to iterate through all the matching
module names.

The code that you've posted returns NULL from MR_search_module_info in two
different cases, when there is no matching module and when there are two
or more matching modules.  This will result in misleading error messages,
e.g. "There is no debugging info about module `foo'" when it ought to
be something like "Module name `foo' is ambiguous".

Otherwise this looks fine.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list