[m-rev.] for review: print message when launching xml browser from mdb

Julien Fischer juliensf at cs.mu.OZ.AU
Wed Feb 2 15:03:25 AEDT 2005


On Wed, 2 Feb 2005, Ian MacLarty wrote:

> For review by anyone.
>
> Estimated hours taken: 0.5
> Branches: both
>
There are more than two branches, so I suggest main, release there.

> Print a message when saving a term to XML and launching the XML browser.
> Do this because for largish terms the browser may take a while to open the XML
> file.
Presuambly, it's processing rather than opening the XML file that takes
time.

The log message should mention the reason for this change: namely
that we don't want the user thinking somthing has gone wrong with
their debugging session, just because the XML browser doesn't
immediately begin.

>
> tests/debugger/browser_test.exp
> 	Expect feedback when `browse --xml' command used.
>
> trace/mercury_trace_internal.c
> 	Print messages before saving a term to XML and launching the XML
> 	browser.
>
> Index: tests/debugger/browser_test.exp
> ===================================================================
> RCS file: /home/mercury1/repository/tests/debugger/browser_test.exp,v
> retrieving revision 1.21
> diff -u -r1.21 browser_test.exp
> --- tests/debugger/browser_test.exp	11 Dec 2004 01:59:51 -0000	1.21
> +++ tests/debugger/browser_test.exp	1 Feb 2005 23:09:47 -0000
> @@ -109,6 +109,8 @@
>  mdb> set xml_tmp_filename './browser_test.xml.out'
>  mdb> set xml_browser_cmd 'cat ./browser_test.xml.out'
>  mdb> browse --xml 1
> +Saving term to XML file...
> +Launching XML browser...
>  <?xml version="1.0"?>
>  <big functor="big" type="browser_test.big" arity="3">
>  	<big functor="big" type="browser_test.big" arity="3">
> @@ -136,6 +138,8 @@
>  	</big>
>  </big>
>  mdb> browse -x Data
> +Saving term to XML file...
> +Launching XML browser...
>  <?xml version="1.0"?>
>  <big functor="big" type="browser_test.big" arity="3">
>  	<big functor="big" type="browser_test.big" arity="3">
> Index: trace/mercury_trace_internal.c
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_internal.c,v
> retrieving revision 1.191
> diff -u -r1.191 mercury_trace_internal.c
> --- trace/mercury_trace_internal.c	1 Feb 2005 03:24:32 -0000	1.191
> +++ trace/mercury_trace_internal.c	1 Feb 2005 23:07:51 -0000
> @@ -1284,6 +1284,8 @@
>  MR_trace_save_and_invoke_xml_browser(MR_Word browser_term)
>  {
>      if (MR_xml_tmp_filename != NULL && (!MR_streq(MR_xml_tmp_filename, ""))) {
> +        fprintf(MR_mdb_out, "Saving term to XML file...\n");
> +        fflush(MR_mdb_out);
>          MR_trace_save_term_xml(MR_xml_tmp_filename, browser_term);
>      } else {
>          fflush(MR_mdb_out);
> @@ -1294,6 +1296,8 @@
>      if (MR_xml_browser_command != NULL &&
>          (!MR_streq(MR_xml_browser_command, "")))
>      {
> +        fprintf(MR_mdb_out, "Launching XML browser...\n");
> +        fflush(MR_mdb_out);
Perhaps that should be:

	Launcing XML browser (this may take some time) ...

>          if (system(MR_xml_browser_command) == -1) {
>              fflush(MR_mdb_out);
>              fprintf(MR_mdb_err, "\nmdb: Error invoking XML browser using "

The looks fine otherwise.

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