[m-rev.] for review: conditional breakpoints

Ralph Becket rafe at cs.mu.OZ.AU
Mon Jan 31 17:49:25 AEDT 2005


Zoltan Somogyi, Monday, 31 January 2005:
> This is for both branches.
> 
> Zoltan.
> 
> Implement a new mdb command, "condition", which associates a condition with
> an existing breakpoint. The condition is a match between a variable live at
> the breakpoint, or a part thereof, and a term provided as part of the condition
> command. If execution arrives at the breakpoint but the match doesn't have the
> required outcome, execution will continue without stopping.

Should be very handy.

> Index: doc/user_guide.texi
> ===================================================================
> RCS file: /home/mercury/mercury1/repository/mercury/doc/user_guide.texi,v
> retrieving revision 1.414
> diff -u -b -r1.414 user_guide.texi
> --- doc/user_guide.texi	28 Jan 2005 02:59:10 -0000	1.414
> +++ doc/user_guide.texi	31 Jan 2005 01:15:10 -0000
> @@ -3022,8 +3022,43 @@
>  @item break info
>  Lists the details, status and print lists of all break points.
>  @sp 1
> - at item ignore [-E at var{ignore-count}] [-I at var{ignore-count}] @var{num}
> + at item condition [-n at var{break-num}] [-p] [-v] @var{varname}[@var{pathspec}] @var{op} @var{term}
> + at kindex condition (mdb command)
> +Attaches a condition to the most recent breakpoint,
> +or, if the @samp{n} or @samp{break-num} is given;
> +execution won't stop at the breakpoint if the condition is false.
> + at sp 1
> +The condition is a match between a variable live at the breakpoint,
> +or a part thereof, and @var{term}.
> +It is ok for @var{term} to contain spaces.
> +The term from the program to be matched
> +is specified by @var{varname};
> +if it is followed by @var{pathspec} (without a space),
> +it specifies that the match is to be
> +against the specified part of @var{varname}.
> + at sp 1
> +There are two values allowed for @var{op}.
> +If @var{op} is @samp{=}, the condition is true
> +if the term specified by @var{printspec} matches @var{term}.
> +If @var{op} is @samp{!=}, the condition is true
> +if the term specified by @var{printspec} doesn't match @var{term}.

I suggest you change != to \= for consistency with Mercury syntax.

Otherwise, that looks fine.

-- Ralph
--------------------------------------------------------------------------
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