diff: runtime/mercury_stack_trace bug fix
Fergus Henderson
fjh at cs.mu.OZ.AU
Thu Dec 17 07:47:07 AEDT 1998
Estimated hours taken: 0.25
runtime/mercury_stack_trace.c:
runtime/mercury_stack_trace.h:
Fix a bug: make sure global variables are declared as `extern'
in the header file and defined in the `.c' file, rather than
being defined in the `.h' file.
Index: runtime/mercury_stack_trace.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_stack_trace.c,v
retrieving revision 1.23
diff -u -r1.23 mercury_stack_trace.c
--- mercury_stack_trace.c 1998/12/09 12:26:29 1.23
+++ mercury_stack_trace.c 1998/12/16 20:44:10
@@ -14,6 +14,20 @@
#include "mercury_stack_trace.h"
#include <stdio.h>
+/*
+** MR_stack_trace_bottom should be set to the address of global_success,
+** the label main/2 goes to on success. Stack dumps terminate when they
+** reach a stack frame whose saved succip slot contains this address.
+*/
+Code *MR_stack_trace_bottom;
+
+/*
+** MR_nondet_stack_trace_bottom should be set to the address of the buffer
+** nondet stack frame created before calling main. Nondet stack dumps terminate
+** when they reach a stack frame whose redoip contains this address. Note that
+** the redoip and redofr slots of this frame may be hijacked.
+*/
+Word *MR_nondet_stack_trace_bottom;
static const char * detism_names[] = {
"failure", /* 0 */
Index: runtime/mercury_stack_trace.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_stack_trace.h,v
retrieving revision 1.13
diff -u -r1.13 mercury_stack_trace.h
--- mercury_stack_trace.h 1998/11/13 08:40:41 1.13
+++ mercury_stack_trace.h 1998/12/16 20:42:45
@@ -123,7 +123,7 @@
** reach a stack frame whose saved succip slot contains this address.
*/
-Code *MR_stack_trace_bottom;
+extern Code *MR_stack_trace_bottom;
/*
** MR_nondet_stack_trace_bottom should be set to the address of the buffer
@@ -132,7 +132,7 @@
** the redoip and redofr slots of this frame may be hijacked.
*/
-Word *MR_nondet_stack_trace_bottom;
+extern Word *MR_nondet_stack_trace_bottom;
/*
** MR_print_proc_id prints an identification of the given procedure,
--
Fergus Henderson <fjh at cs.mu.oz.au> | "Binaries may die
WWW: <http://www.cs.mu.oz.au/~fjh> | but source code lives forever"
PGP: finger fjh at 128.250.37.3 | -- leaked Microsoft memo.
More information about the developers
mailing list