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

Julien Fischer juliensf at csse.unimelb.edu.au
Fri Apr 27 01:41:11 AEST 2012



On Mon, 23 Apr 2012, Zoltan Somogyi 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.
>
> Zoltan.
>
> Give the Mercury debugger the ability to detect cliques of mutually recursive
> predicates on the stack. Exploit this ability to enhance the debugger's
> level, retry, finish and stack commands.
>
> runtime/mercury_stack_trace.[ch]:
> 	Add a function, MR_find_clique_entry, that detects the clique
> 	that contains the top stack frame. This is used to implement the new
> 	arguments "clentry" and "clparent" (short for clique entry and parent)
> 	options of the level, retry and finish commands.
>
> 	Add a function, MR_dump_stack_layout_clique, that implements the
> 	new capabilities of the stack command. It can detect more than one
> 	clique, anywhere on the stack.
>
> 	To make this possible, modify the existing functions for printing
> 	the lines of stack traces. These used to keep some information around
> 	between calls in global variables. Now that information is stored in
> 	two structures that the caller passes them. One contains the parameters
> 	that govern what is to be printed, the other contains information about
> 	what has been buffered up to be printed, but has not been flushed yet.
> 	(The old code was confused in its handling of parameters. Some parts
> 	of it looked up the global variables storing them, while other parts
> 	were given the parameter values by their callers, values that could
> 	have been -but weren't- inconsistent.)
>
> 	Change the buffer flushing code to be idempotent, since in the new
> 	code, sometimes it hard to avoid flushing the buffer more than once,
> 	and we want only the first to print its contents.
>
> 	Make some type names conform to our standard style.
>
> runtime/mercury_malloc.[ch]:
> 	Add a module containing definitions of checked_malloc and
> 	checked_realloc. The new code in mercury_stack_trace.c uses them.

Is there a reason why you didn't just use MR_malloc and MR_realloc
(exported from runtime/mercury_memory.h)?

Also, the changes to the util directory are not mentioned in the log
message.

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