[m-rev.] for review: cliques on the stack and the debugger

Peter Wang novalazy at gmail.com
Thu Apr 26 22:33:00 AEST 2012


On Mon, 23 Apr 2012 16:28:03 +1000, Zoltan Somogyi <zs at unimelb.edu.au> wrote:
> I am seeking feedback particularly on the user interface aspects of this diff:
> what options and arguments mdb users give, and what the format of the output
> is. For that, you want to read the diff to doc/user_guide.texi.

I think I'd have a better chance of remembering "retry clique" than
"clentry".

> Index: doc/user_guide.texi
> ===================================================================
> RCS file: /home/mercury/mercury1/repository/mercury/doc/user_guide.texi,v
> retrieving revision 1.650
> diff -u -b -r1.650 user_guide.texi
> --- doc/user_guide.texi	5 Apr 2012 05:57:45 -0000	1.650
> +++ doc/user_guide.texi	23 Apr 2012 03:54:47 -0000
> @@ -2680,13 +2680,34 @@
>  @sp 1
>  By default, this command is strict, and it uses the default print level.
>  @sp 1
> - at item finish [-NSans] [@var{num}]
> + at item finish [-NSans]
> + at item finish [-NSans] @var{num}
> + at item finish [-NSans] @samp{clentry}
> + at item finish [-NSans] @samp{clparent}
>  @kindex finish (mdb command)
> -Continues execution until it reaches a final (EXIT, FAIL or EXCP) port
> +If invoked without arguments,
> +continues execution until it reaches a final (EXIT, FAIL or EXCP) port
> +of the current call.
> +If invoked with the number @var{num} as argument,
> +continues execution until it reaches a final port
>  of the @var{num}'th ancestor of the call to which the current event refers.
> -The default value of @var{num} is zero,
> -which means skipping to the end of the current call.
> -Reports an error if execution is already at the desired port.
> +If invoked with the argument @samp{clentry},
> +continues execution until it reaches a final port of the call
> +that first entered into the clique of recursive calls
> +of which the current call is a part.
> +(If the current call is not (mutually) recursive
> +with any other currently active call,
> +it will skip to the end of current call.)

Can you avoid the doubly nested parentheses?

> +If the command is given the argument @samp{clparent},
> +it skips to the end of the first call outside the current call's clique.
> +This will the parent of the call that @samp{finish clentry} would finish.

"will the"

This occurs a few times.

> + at sp 1
> +If invoked as @samp{finish clentry} and @samp{finish clparent},
> +this command will report an error
> +unless we have stack trace information
> +about all of the current call's ancestors.
> + at sp 1
> +Also reports an error if execution is already at the desired port.

> @@ -2827,18 +2848,37 @@
>  
>  @sp 1
>  @table @code
> - at item retry [-fio] [@var{num}]
> + at item retry [-fio]
> + at item retry [-fio] @var{num}
> + at item retry [-fio] @samp{clentry}
> + at item retry [-fio] @samp{clparent}
>  @c @item retry [-afio] [@var{num}]
>  @kindex retry (mdb command)
> -If the optional number is not given,
> +If the command is given no arguments,
>  restarts execution at the call port
>  of the call corresponding to the current event.

I think reads slightly better:

    If given no arguments, the command restarts execution ...

> @@ -3114,11 +3165,30 @@
>  the call's event number, sequence number and depth should also be printed
>  if the call is to a procedure that is being execution traced.
>  @sp 1
> - at item level [-d] [@var{num}]
> + at item level [-d]
> + at item level [-d] @var{num}
> + at item level [-d] @samp{clentry}
> + at item level [-d] @samp{clparent}
>  @kindex level (mdb command)
> -Sets the current environment to the stack frame of the @var{num}'th
> -level ancestor of the call to which the current event belongs.
> -The zero'th ancestor is the call of the event itself.
> +If invoked without arguments,
> +sets the current environment
> +to the stack frame that belongs to the current event.
> +If invoked with the number @var{num} as argument,
> +sets the current environment
> +to the stack frame of the @var{num}'th level ancestor
> +of the call to which the current event belongs.
> +If invoked with the argument @samp{clentry},
> +sets the current environment to the stack frame of the call
> +that first entered into the clique of recursive calls
> +of which the current call is a part.
> +(If the current call is not (mutually) recursive
> +with any other currently active call,
> +it set the current environment to the stack frame of the current event.)

it set


> +   0       pred mutrec_higher_order.q3/3-0 (det) (mutrec_higher_order.m:233)
> +   1       pred mutrec_higher_order.q1/3-0 (det) (mutrec_higher_order.m:186)
> +   2       pred mutrec_higher_order.q2/3-0 (det) (mutrec_higher_order.m:213)
> +   3       pred mutrec_higher_order.repeat_steps/5-0 (det) (mutrec_higher_order.m:78)
> +<mutually recursive set of stack frames start>
> +   4    2* pred mutrec_higher_order.p2/3-0 (det) (mutrec_higher_order.m:133 and others)
> +   6       pred mutrec_higher_order.p3/3-0 (det) (mutrec_higher_order.m:155)
> +   7    2* pred mutrec_higher_order.p2/3-0 (det) (mutrec_higher_order.m:126 and others)
> +   9       pred mutrec_higher_order.p3/3-0 (det) (mutrec_higher_order.m:155)
> +<mutually recursive set of stack frames end>
> +  10    2* pred mutrec_higher_order.p1/3-0 (det) (mutrec_higher_order.m:97 and others)
> +  12       pred mutrec_higher_order.test/2-0 (det) (mutrec_higher_order.m:43)
> +  13       pred mutrec_higher_order.main/2-0 (det) (mutrec_higher_order.m:34)

Later, it would be nice to display cliques less obtrusively, e.g.

   0       pred mutrec_higher_order.q3/3-0 (det) (mutrec_higher_order.m:233)
   1       pred mutrec_higher_order.q1/3-0 (det) (mutrec_higher_order.m:186)
   2       pred mutrec_higher_order.q2/3-0 (det) (mutrec_higher_order.m:213)
   3       pred mutrec_higher_order.repeat_steps/5-0 (det) (mutrec_higher_order.m:78)
   4  ┌ 2* pred mutrec_higher_order.p2/3-0 (det) (mutrec_higher_order.m:133 and others)
   6  │    pred mutrec_higher_order.p3/3-0 (det) (mutrec_higher_order.m:155)
   7  │ 2* pred mutrec_higher_order.p2/3-0 (det) (mutrec_higher_order.m:126 and others)
   9  └    pred mutrec_higher_order.p3/3-0 (det) (mutrec_higher_order.m:155)
  10    2* pred mutrec_higher_order.p1/3-0 (det) (mutrec_higher_order.m:97 and others)
  12       pred mutrec_higher_order.test/2-0 (det) (mutrec_higher_order.m:43)
  13       pred mutrec_higher_order.main/2-0 (det) (mutrec_higher_order.m:34)

Peter
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list