[m-rev.] for review: fix bugs in mdb breakpoint procedure specification

Zoltan Somogyi zs at cs.mu.OZ.AU
Mon Feb 11 08:09:23 AEDT 2002


On 11-Feb-2002, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> Fix bugs in the code to parse and match procedure
> specifications for breakpoints:
> - handle nested modules.
> - handle names containing '/' and '-'.
> - use the correct arity for functions, not the arity of the
>   corresponding predicate.

Thanks, Simon. That looks good, except for the following thing.

> +	end = str + len - 1;
> +	if (MR_parse_trailing_number(str, &end, &n)) {
> +		if (end < str) {
> +			/* the string contains only a number */
> +			return FALSE;

I think Fergus would tell you that ANSI C doesn't guarantee that you can
subtract one from the address of a memory block, since that may not work
on segmented architectures (if they actually use segments, which sane
operating systems on the x86 do not). You could replace the "end < str"
test with an "end == NULL" test after the corresponding modification in
MR_parse_trailing_number of course.

An issue raised by your diff to breakpoints.exp* is whether the debugger
should allow two or more identical breakpoints. When it sees the programmer
trying to create a redundant breakpoint, mdb could refuse to do it, it could
ask confirmation, or it could at least print a warning. What do people think?

Zoltan.
--------------------------------------------------------------------------
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