[m-dev.] diff: move the initialisation of MR_mmc_options in MR_trace_event_external()
Erwan Jahier
Erwan.Jahier at irisa.fr
Wed May 26 20:09:25 AEST 1999
| The log message should explain the rationale for the change.
[...]
| The two different declarations of MR_mmc_options in different functions
| each define a different variable. So the variable that gets initialized
| is not the same as the variable that gets used. You need to make the
| declaration of MR_mmc_options global to that C file.
|
Estimated hours taken: 0.2
Initialise the variable MR_mmc_options in MR_trace_init_external() rather than
in MR_trace_event_external() as it is useless to pay the price of a call to
MR_TRACE_CALL_MERCURY() for every event.
trace/mercury_trace_external.c:
Move the call to
MR_TRACE_CALL_MERCURY(ML_DI_init_mercury_string(&MR_mmc_options))
from MR_trace_event_external() to MR_trace_init_external().
Index: trace/mercury_trace_external.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_external.c,v
retrieving revision 1.17
diff -u -r1.17 mercury_trace_external.c
--- mercury_trace_external.c 1999/05/21 14:38:21 1.17
+++ mercury_trace_external.c 1999/05/26 10:02:25
@@ -83,6 +83,8 @@
MercuryFile MR_debugger_socket_in;
MercuryFile MR_debugger_socket_out;
+String MR_mmc_options;
+
/*
** Use a GNU C extension to enforce static type checking
** for printf-style functions.
@@ -214,6 +216,13 @@
Word debugger_request;
Integer debugger_request_type;
+ /*
+ ** MR_mmc_options contains the options to pass to mmc when compiling
+ ** queries. We initialise it to the String "".
+ */
+
+ MR_TRACE_CALL_MERCURY(ML_DI_init_mercury_string(&MR_mmc_options));
+
/*
** We presume that the user's program has been invoked from
** within the debugger (e.g. Opium).
@@ -401,13 +410,6 @@
Integer modules_list_length;
Word modules_list;
int ancestor_level;
-
- /*
- ** MR_mmc_options contains the options to pass to mmc when compiling
- ** queries. We initialise it to the String "".
- */
- static String MR_mmc_options;
- MR_TRACE_CALL_MERCURY(ML_DI_init_mercury_string(&MR_mmc_options));
/* by default, print variables from the current call */
ancestor_level = 0;
--
R1.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list