[m-rev.] for review: mdb: break proc_spec port_name

Julien Fischer juliensf at csse.unimelb.edu.au
Tue Jun 12 15:39:34 AEST 2007


On Tue, 12 Jun 2007, Zoltan Somogyi wrote:

> Satisfy a request by Peter Ross: give mdb users the ability to specify
> exactly which events inside a procedure they want to put breakpoints on.
> Amongst other things, this can make checking postconditions easier:
> you can now put a conditional breakpoint on only the exit event.
>
> runtime/mercury_stack_layout.h:
> 	Add fields to the exec trace part of proc layouts an array of the
> 	label layouts describing the events of the procedure.

... and an array of ... (?)

>       This is the
> 	most direct way to implement the new functionality. (In theory,
> 	we could search the data structures that map file names and line
> 	numbers to label layouts, but that would be complex, inefficient,
> 	and *error prone*.)
>
> 	To make room for the new fields, and to prepare for making the
> 	procedure body available to the deep profiler as well (which could
> 	use it to map execution frequencies of calls back to their location
> 	in the procedure body, and thus to things like the frequencies with
> 	which various switch arms are selected), move the procedure body
> 	of the execution-trace-specific part of the proc layout, and to
> 	where the deep profiler could in the future also get at it.
>
> runtime/mercury_goto.h:
> 	Add macros for declaring more than one label layout structure at a
> 	time.
>
> compiler/layout.m:
> 	Implement the changes in mercury_stack_layout.h in the compiler's
> 	data structures as well.
>
> compiler/stack_layout.m:
> 	Conform to the changes in mercury_stack_layout.h.
>
> 	Turn some tuples into named types.
>
> compiler/layout_out.m:
> 	Conform to the changes in mercury_stack_layout.h.
>
> 	Add a mechanism to declare the label layouts in the new array before
> 	referring to them, by generalizing some existing code. Make this code
> 	require that the label layouts we refer to via the macros in
> 	mercury_goto.h match the declarations generated by those macros,
> 	i.e. that they have information about variables (if debugging is
> 	enabled, they will).
>
> compiler/opt_debug.m:
> 	Conform to the change to layout.m.
>
> compiler/prog_rep.m:
> 	Make a predicate name more expressive.
>
> trace/mercury_trace_cmd_breakpoint.c:
> 	Implement the new way of using the "break" command, which is
> 	to add a port name after the procedure specification.
>
> 	Register procedures at the start of the function implementing
> 	the "break" command, instead of "on demand", since all alternatives
> 	eventually do demand it.
>
> 	Write ambiguity reports wholly to mdb's stdout, instead of partially to
> 	stderr and partially to stdout.
>
> trace/mercury_trace_spy.c:
> 	Print the port and the goal path for breakpoints on specific events.
>
> 	Make the invocation conditions left-aligned, not right-aligned.
>
> doc/user_guide.texi:
> 	Document the new way of using the "break" command.
>
> NEWS:
> 	Announce the new capability.
>
> tests/queens.{inp,exp,exp2}:
> 	Add tests of the new capability.
>
> tests/breakpoints.{exp,exp}:
> tests/lval_desc_array.{exp,exp2}:
> 	Expect the new alignment of invocation conditions.

...


> Index: doc/user_guide.texi
> ===================================================================
> RCS file: /home/mercury/mercury1/repository/mercury/doc/user_guide.texi,v
> retrieving revision 1.523
> diff -u -r1.523 user_guide.texi
> --- doc/user_guide.texi	7 Jun 2007 06:53:52 -0000	1.523
> +++ doc/user_guide.texi	9 Jun 2007 01:10:07 -0000
> @@ -3309,6 +3309,52 @@
> its invocation condition is @samp{interface},
> the ignore count is zero, and the print list is empty.
> @sp 1
> + at item break [-OPS] [-E at var{ignore-count}] [-I at var{ignore-count}] [-n] [-p at var{print-spec}]* @var{proc-spec} @var{portname}
> +Puts a break point on
> +one or more events of the specified type in the specified procedure.
> +Port names should be specified as they are printed at events,
> +e.g. @samp{CALL}, @samp{EXIT}, @samp{DISJ}, @samp{SWTC}, etc.

Must the portnames always be uppercase?

Is it possible to also specify the goal path (where appropriate) with
the portname as part of the break command?

The rest looks okay.

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