[m-dev.] for review: workaround for the large term problem in the debugger

Tyson Dowd trd at stimpy.cs.mu.oz.au
Sat Jun 13 13:45:43 AEST 1998


On 12-Jun-1998, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> 
> Tyson, please check this.
> 
> runtime/mercury_trace_internal.c:
> 	Separate the functionality of the old 'p'" command into two parts.
> 	The new 'v' command lists the live variables, giving a number to each.
> 	The new 'p' command takes an argument. If this argument is a number,
> 	it prints the variable with that number in the list produced by 'v'.
> 	If this argument is '*', it prints all variables.
> 
> Zoltan.


> 
> Index: mercury_trace_internal.c
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/runtime/mercury_trace_internal.c,v
> retrieving revision 1.4
> diff -u -u -r1.4 mercury_trace_internal.c
> --- mercury_trace_internal.c	1998/06/08 08:27:11	1.4
> +++ mercury_trace_internal.c	1998/06/12 07:58:15

> +	} else if (streq(words[0], "p")) {
> +		if (word_count == 2) {
> +			if (MR_trace_is_number(words[1], &n)) {
> +				if (n < layout->MR_sll_var_count) {
> +					MR_trace_browse_one(n,
> +						&layout->MR_sll_var_info);
> +				} else {
> +					printf("There is no variable #%d.\n",
> +						n);
> +				}
> +			} else {
> +				MR_trace_browse_all((int)
> +					layout->MR_sll_var_count,
> +					&layout->MR_sll_var_info);
> +			}
> +		} else {
> +			printf("This command expects one argument,\n");
> +			printf("a variable number or a '*' indicating all variables.\n");
> +		}

Not entirely true -- '*' or any other non-number will indicate all
variables.  Might be confusing to type 'p X' and have it print all
variables.  This isn't a big deal, but at least add an XXX to say
this should be fixed.

You should probably co-ordinate this change with Erwan if there is
common code, but this can be done later.

Otherwise the change is fine.

-- 
       Tyson Dowd           # "Bill Gates is a white persian cat and a monocle
                            # away from becoming another James Bond villan."
     trd at cs.mu.oz.au        # "No Mr Bond, I expect you to upgrade."
http://www.cs.mu.oz.au/~trd #                -- Dennis Miller and Terri Branch



More information about the developers mailing list