[m-rev.] For review: Made declarative debugger use mdb format settings

Julien Fischer juliensf at cs.mu.OZ.AU
Fri Oct 22 18:34:43 AEST 2004


On Thu, 21 Oct 2004, Ian MacLarty wrote:

> For review by anyone.
>
> Estimated hours taken: 3
> Branches: main
>
> Made the declarative debugger respect the format settings of the procedural
> debugger.  So the print format set in the procedural debugger will be used when
> the declarative debugger asks questions and the browse format will be used when
> browsing terms in the declarative debugger.  If the user changes the browser
> format during a declarative debugging session the procedural debugger will
> respect these changes.
>
I'd suggest rewording the first part of that as follows:

Make the declarative debugger respect the format settings of the
procedural debugger.  The print format set in procedural debugger will
now be used when the declarative debugger asks questions and the browse
format will now be used when browsing terms in the declarative debugger.

> This also means the declarative debugger will respect the settings in the
> .mdbrc file.
>
> browser/declarative_debugger.m
> 	Added term browser state arguments to main diagnosis predicate and
> 	initialisation predicate.
>
> browser/declarative_oracle.m
> 	Added predicates to get and set the term browser state.
> 	Set the term browser state in the initialisation prediciate for the
> 	oracle state.
>
> browser/declarative_user.m
> 	Added predicates to get and set the term browser state.
> 	Set the term browser state in the initialisation prediciate for the
> 	user state.
>
> tests/debugger/declarative/dependency.exp
> 	This test sets the print format in the procedural debugger, so
> 	the declarative debugger now uses this format.
>
> trace/mercury_trace_browse.c
> trace/mercury_trace_browse.h
> 	Exported global which stores the state of the procedural debugger
> 	term browser and the function which initialises this state, so they can
> 	be used from mercury_trace_declarative.c.

s/global/a global variable/

>
> trace/mercury_trace_declarative.c
> 	Pass the procedural debugger term browser state to the declarative
> 	debugger and update the state when the declarative debugger is
> 	finished.
>
...
> Index: trace/mercury_trace_browse.c
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_browse.c,v
> retrieving revision 1.32
> diff -u -r1.32 mercury_trace_browse.c
> --- trace/mercury_trace_browse.c	9 Aug 2004 03:05:23 -0000	1.32
> +++ trace/mercury_trace_browse.c	21 Oct 2004 03:58:52 -0000
> @@ -38,10 +38,11 @@
>
>  #include <stdio.h>
>
> -static	MR_Word		MR_trace_browser_persistent_state;
>  static	MR_TypeInfo	MR_trace_browser_persistent_state_type;
>
> -static	void		MR_trace_browse_ensure_init(void);
> +MR_Word	MR_trace_browser_persistent_state;
> +
> +void	MR_trace_browse_ensure_init(void);
>

The function prototype for MR_trace_browse_ensure_init() is now in
the header file; there's no point having another one here.

>  static	MR_bool		MR_trace_is_portray_format(const char *str,
>  				MR_Browse_Format *format);
> @@ -356,7 +357,7 @@
>  	return MR_FALSE;
>  }
>
> -static void
> +void
>  MR_trace_browse_ensure_init(void)
>  {
>  	static	MR_bool	done = MR_FALSE;
> Index: trace/mercury_trace_browse.h
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_browse.h,v
> retrieving revision 1.16
> diff -u -r1.16 mercury_trace_browse.h
> --- trace/mercury_trace_browse.h	13 May 2004 08:50:32 -0000	1.16
> +++ trace/mercury_trace_browse.h	21 Oct 2004 03:58:29 -0000
> @@ -106,4 +106,8 @@
>  			int num_imports, MR_Word imports_list);
>  #endif
>
> +extern	MR_Word	MR_trace_browser_persistent_state;
> +
> +extern	void	MR_trace_browse_ensure_init(void);
> +
>  #endif	/* MERCURY_TRACE_BROWSE_H */

It wouldn't hurt to have a brief comment here describing what
these do.

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