[m-dev.] diff: fix stack tracing bug again

Fergus Henderson fjh at cs.mu.OZ.AU
Sun Feb 28 13:08:15 AEDT 1999


On 28-Feb-1999, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> Re-fix a bug that was causing mdb's detailed stack traces to come out
> incorrectly on some occaisions. [...]

Sorry, that diff was a bit different to the one I will commit,
because I forgot to do a cvs update before making that diff.
Here's the one I'll commit.

Estimated hours taken: 0.75

Re-fix a bug that was causing mdb's detailed stack traces to come out
incorrectly on some occaisions.  Erwan's recent changes accidentally
removed my previous fix of this bug.  Also fix another occurrence
of a very similar bug.  And fix a compiler warning in Erwan's new code.

trace/mercury_trace_external.c:
runtime/mercury_stack_trace.c:
        Re-fix a bug: `maybe_from_full' should have type `Integer', not `Word'.

runtime/mercury_stack_trace.c:
	Fix a compiler warning: delete the unnecessary `extern' from
	the definition of MR_detism_names.

runtime/mercury_trace_base.c:
        Fix a bug: `maybe_from_full' should have type `Integer', not `bool'.

Index: runtime/mercury_stack_trace.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_stack_trace.c,v
retrieving revision 1.28
diff -u -r1.28 mercury_stack_trace.c
--- mercury_stack_trace.c	1999/02/23 08:06:46	1.28
+++ mercury_stack_trace.c	1999/02/28 02:04:56
@@ -368,7 +368,8 @@
 	if (base_sp != NULL && base_curfr != NULL) {
 		bool print_details = FALSE;
 		if (MR_ENTRY_LAYOUT_HAS_EXEC_TRACE(entry)) {
-			Word maybe_from_full = entry->MR_sle_maybe_from_full;
+			Integer maybe_from_full =
+				entry->MR_sle_maybe_from_full;
 			if (maybe_from_full > 0) {
 				/*
 				** for procedures compiled with shallow
@@ -470,7 +471,7 @@
 ** the names that are usually used to denote determinisms.
 */
 
-extern const char * MR_detism_names[] = {
+const char * MR_detism_names[] = {
 	"failure",	/* 0 */
 	"",		/* 1 */
 	"semidet",	/* 2 */
Index: runtime/mercury_trace_base.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_trace_base.c,v
retrieving revision 1.11
diff -u -r1.11 mercury_trace_base.c
--- mercury_trace_base.c	1999/02/20 06:08:08	1.11
+++ mercury_trace_base.c	1999/02/28 01:50:18
@@ -89,7 +89,7 @@
 ** control in the debugger when main/2 is called.
 */
 
-Bool		MR_trace_from_full = 1;
+Bool		MR_trace_from_full = TRUE;
 
 #ifdef	MR_TRACE_HISTOGRAM
 
@@ -106,7 +106,7 @@
 MR_trace(const MR_Stack_Layout_Label *layout, MR_Trace_Port port,
 	const char * path, int max_mr_num)
 {
-	bool		maybe_from_full;
+	Integer		maybe_from_full;
 	Unsigned	seqno;
 	Unsigned	depth;
 
Index: trace/mercury_trace_external.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_external.c,v
retrieving revision 1.11
diff -u -r1.11 mercury_trace_external.c
--- mercury_trace_external.c	1999/02/22 08:28:32	1.11
+++ mercury_trace_external.c	1999/02/28 02:00:45
@@ -945,7 +945,8 @@
 	if (base_sp != NULL && base_curfr != NULL) {
 		bool print_details = FALSE;
 		if (MR_ENTRY_LAYOUT_HAS_EXEC_TRACE(entry)) {
-			Word maybe_from_full = entry->MR_sle_maybe_from_full;
+			Integer maybe_from_full =
+				entry->MR_sle_maybe_from_full;
 			if (maybe_from_full > 0) {
 				/*
 				** for procedures compiled with shallow

-- 
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