[m-dev.] for review: fix RTTI bug affecting large stack frames

Zoltan Somogyi zs at cs.mu.OZ.AU
Mon Dec 10 13:59:19 AEDT 2001


For review by anyone.

Fix a bug that caused a core dump if the debugger attempted to look at stack
frames with more than 64 live variables on the stack.

runtime/mercury_stack_layout.h:
	Fix a bug. The array of lval descriptors in a label layout structures
	has two components: the long descriptors and the short descriptors.
	The bug was that we were using an index with respect to the start
	of the first subarray to index into the second subarray. The fix is
	to subtract the length of the first subarray from the index first.
	(This problem rarely bit before because the first subarray's length
	is almost always zero.)

runtime/mercury_layout_util.c:
	Improve existing debugging code, but make its compilation conditional.
	The difference this makes in runtime is not significant for the
	debugger, but would be significant for native gc.

runtime/mercury_conf_param.h:
	Document the macro the debugging code is conditional on.

trace/mercury_trace_vars.c:
	Set unused fields of Var_Spec structures to explicitly invalid values,
	to avoid possible misinterpretation when using gdb.

tests/debugger/lval_desc_array.{m,inp,exp,exp2}:
	A regression test to check for the presence of the bug.

tests/debugger/Mmakefile:
	Enable the new test case.

Zoltan.

cvs diff: Diffing .
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing java
cvs diff: Diffing library
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
Index: runtime/mercury_conf_param.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_conf_param.h,v
retrieving revision 1.49
diff -u -b -r1.49 mercury_conf_param.h
--- runtime/mercury_conf_param.h	2001/12/04 00:44:32	1.49
+++ runtime/mercury_conf_param.h	2001/12/10 02:46:26
@@ -189,6 +189,10 @@
 ** MR_DEBUG_JMPBUFS
 ** 	Enables low-level debugging messages from MR_call_engine and the
 ** 	code handling exceptions.
+**
+** MR_DEBUG_LVAL_REP
+** 	Enables low-level debugging messages from routines concerned with
+** 	the representation of lvals in the RTTI system.
 */
 
 #if MR_DEBUG_AGC_ALL
Index: runtime/mercury_layout_util.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_layout_util.c,v
retrieving revision 1.23
diff -u -b -r1.23 mercury_layout_util.c
--- runtime/mercury_layout_util.c	2001/08/07 23:12:26	1.23
+++ runtime/mercury_layout_util.c	2001/12/07 07:02:01
@@ -166,8 +166,10 @@
 	}
 }
 
+#ifdef	MR_DEBUG_LVAL_REP
 /* if you want to debug this code, you may want to set this var to TRUE */
-static	bool	MR_print_locn = FALSE;
+static	bool	MR_print_locn = TRUE;
+#endif
 
 MR_Word
 MR_lookup_long_lval(MR_Long_Lval locn, MR_Word *saved_regs, bool *succeeded)
@@ -193,69 +195,90 @@
 	locn_num = (int) MR_LONG_LVAL_NUMBER(locn);
 	switch (MR_LONG_LVAL_TYPE(locn)) {
 		case MR_LONG_LVAL_TYPE_R:
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("r%d", locn_num);
+				printf("closure r%d\n", locn_num);
 			}
+#endif
 			if (locn_num <= closure->MR_closure_num_hidden_args) {
-				value = closure->MR_closure_hidden_args(locn_num);
+				value = closure->
+					MR_closure_hidden_args(locn_num);
 				*succeeded = TRUE;
 			}
 			break;
 
 		case MR_LONG_LVAL_TYPE_F:
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("f%d", locn_num);
+				printf("closure f%d\n", locn_num);
 			}
+#endif
 			break;
 
 		case MR_LONG_LVAL_TYPE_STACKVAR:
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("stackvar%d", locn_num);
+				printf("closure stackvar%d\n", locn_num);
 			}
+#endif
 			break;
 
 		case MR_LONG_LVAL_TYPE_FRAMEVAR:
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("framevar%d", locn_num);
+				printf("closure framevar%d\n", locn_num);
 			}
+#endif
 			break;
 
 		case MR_LONG_LVAL_TYPE_SUCCIP:
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("succip");
+				printf("closure succip\n");
 			}
+#endif
 			break;
 
 		case MR_LONG_LVAL_TYPE_MAXFR:
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("maxfr");
+				printf("closure maxfr\n");
 			}
+#endif
 			break;
 
 		case MR_LONG_LVAL_TYPE_CURFR:
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("curfr");
+				printf("closure curfr\n");
 			}
+#endif
 			break;
 
 		case MR_LONG_LVAL_TYPE_HP:
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("hp");
+				printf("closure hp\n");
 			}
+#endif
 			break;
 
 		case MR_LONG_LVAL_TYPE_SP:
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("sp");
+				printf("closure sp\n");
 			}
+#endif
 			break;
 
 		case MR_LONG_LVAL_TYPE_INDIRECT:
 			offset = MR_LONG_LVAL_INDIRECT_OFFSET(locn_num);
 			sublocn = MR_LONG_LVAL_INDIRECT_BASE_LVAL(locn_num);
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("offset %d from ", offset);
+				printf("closure offset %d from ", offset);
 			}
+#endif
 			baseaddr = MR_lookup_closure_long_lval(sublocn,
 					closure, succeeded);
 			if (! *succeeded) {
@@ -267,15 +290,19 @@
 			break;
 
 		case MR_LONG_LVAL_TYPE_UNKNOWN:
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("unknown");
+				printf("closure unknown\n");
 			}
+#endif
 			break;
 
 		default:
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("DEFAULT");
+				printf("closure DEFAULT\n");
 			}
+#endif
 			break;
 	}
 
@@ -298,9 +325,11 @@
 	locn_num = (int) MR_LONG_LVAL_NUMBER(locn);
 	switch (MR_LONG_LVAL_TYPE(locn)) {
 		case MR_LONG_LVAL_TYPE_R:
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("r%d", locn_num);
+				printf("long r%d\n", locn_num);
 			}
+#endif
 			if (saved_regs != NULL) {
 				value = MR_saved_reg(saved_regs, locn_num);
 				*succeeded = TRUE;
@@ -308,63 +337,81 @@
 			break;
 
 		case MR_LONG_LVAL_TYPE_F:
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("f%d", locn_num);
+				printf("long f%d\n", locn_num);
 			}
+#endif
 			break;
 
 		case MR_LONG_LVAL_TYPE_STACKVAR:
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("stackvar%d", locn_num);
+				printf("long stackvar%d\n", locn_num);
 			}
+#endif
 			value = MR_based_stackvar(base_sp, locn_num);
 			*succeeded = TRUE;
 			break;
 
 		case MR_LONG_LVAL_TYPE_FRAMEVAR:
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("framevar%d", locn_num);
+				printf("long framevar%d\n", locn_num);
 			}
+#endif
 			value = MR_based_framevar(base_curfr, locn_num);
 			*succeeded = TRUE;
 			break;
 
 		case MR_LONG_LVAL_TYPE_SUCCIP:
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("succip");
+				printf("long succip\n");
 			}
+#endif
 			break;
 
 		case MR_LONG_LVAL_TYPE_MAXFR:
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("maxfr");
+				printf("long maxfr\n");
 			}
+#endif
 			break;
 
 		case MR_LONG_LVAL_TYPE_CURFR:
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("curfr");
+				printf("long curfr\n");
 			}
+#endif
 			break;
 
 		case MR_LONG_LVAL_TYPE_HP:
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("hp");
+				printf("long hp\n");
 			}
+#endif
 			break;
 
 		case MR_LONG_LVAL_TYPE_SP:
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("sp");
+				printf("long sp\n");
 			}
+#endif
 			break;
 
 		case MR_LONG_LVAL_TYPE_INDIRECT:
 			offset = MR_LONG_LVAL_INDIRECT_OFFSET(locn_num);
 			sublocn = MR_LONG_LVAL_INDIRECT_BASE_LVAL(locn_num);
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("offset %d from ", offset);
+				printf("long offset %d from ", offset);
 			}
+#endif
 			baseaddr = MR_lookup_long_lval_base(sublocn,
 					saved_regs, base_sp, base_curfr,
 					succeeded);
@@ -377,15 +424,19 @@
 			break;
 
 		case MR_LONG_LVAL_TYPE_UNKNOWN:
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("unknown");
+				printf("long unknown\n");
 			}
+#endif
 			break;
 
 		default:
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("DEFAULT");
+				printf("long DEFAULT\n");
 			}
+#endif
 			break;
 	}
 
@@ -413,9 +464,11 @@
 	locn_num = (int) locn >> MR_SHORT_LVAL_TAGBITS;
 	switch (MR_SHORT_LVAL_TYPE(locn)) {
 		case MR_SHORT_LVAL_TYPE_R:
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("r%d", locn_num);
+				printf("short r%d\n", locn_num);
 			}
+#endif
 			if (saved_regs != NULL) {
 				value = MR_saved_reg(saved_regs, locn_num);
 				*succeeded = TRUE;
@@ -423,17 +476,21 @@
 			break;
 
 		case MR_SHORT_LVAL_TYPE_STACKVAR:
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("stackvar%d", locn_num);
+				printf("short stackvar%d\n", locn_num);
 			}
+#endif
 			value = MR_based_stackvar(base_sp, locn_num);
 			*succeeded = TRUE;
 			break;
 
 		case MR_SHORT_LVAL_TYPE_FRAMEVAR:
+#ifdef	MR_DEBUG_LVAL_REP
 			if (MR_print_locn) {
-				printf("framevar%d", locn_num);
+				printf("short framevar%d\n", locn_num);
 			}
+#endif
 			value = MR_based_framevar(base_curfr, locn_num);
 			*succeeded = TRUE;
 			break;
@@ -441,46 +498,55 @@
 		case MR_SHORT_LVAL_TYPE_SPECIAL:
 			switch (locn_num) {
 				case MR_LONG_LVAL_TYPE_SUCCIP:
+#ifdef	MR_DEBUG_LVAL_REP
 					if (MR_print_locn) {
-						printf("succip");
+						printf("short succip\n");
 					}
+#endif
 					break;
 
 				case MR_LONG_LVAL_TYPE_MAXFR:
+#ifdef	MR_DEBUG_LVAL_REP
 					if (MR_print_locn) {
-						printf("maxfr");
+						printf("short maxfr\n");
 					}
+#endif
 					break;
 
 				case MR_LONG_LVAL_TYPE_CURFR:
+#ifdef	MR_DEBUG_LVAL_REP
 					if (MR_print_locn) {
-						printf("curfr");
+						printf("short curfr\n");
 					}
+#endif
 					break;
 
 				case MR_LONG_LVAL_TYPE_HP:
+#ifdef	MR_DEBUG_LVAL_REP
 					if (MR_print_locn) {
-						printf("hp");
+						printf("short hp\n");
 					}
+#endif
 					break;
 
 				case MR_LONG_LVAL_TYPE_SP:
+#ifdef	MR_DEBUG_LVAL_REP
 					if (MR_print_locn) {
-						printf("sp");
+						printf("short sp\n");
 					}
+#endif
 					break;
 
 				default:
+#ifdef	MR_DEBUG_LVAL_REP
 					if (MR_print_locn) {
-						printf("DEFAULT");
+						printf("short spec DEFAULT\n");
 					}
+#endif
 			}
 
 		default:
-			if (MR_print_locn) {
-				printf("DEFAULT");
-			}
-			break;
+			MR_fatal_error("MR_lookup_short_lval_base: bad type");
 	}
 
 	return value;
@@ -508,10 +574,16 @@
 	*type_info = MR_create_type_info(type_params, pseudo_type_info);
 
 	if (i < MR_long_desc_var_count(label_layout)) {
+#ifdef	MR_DEBUG_LVAL_REP
+		printf("looking up long lval\n");
+#endif
 		*value = MR_lookup_long_lval_base(
 			MR_long_desc_var_locn(label_layout, i),
 			saved_regs, base_sp, base_curfr, &succeeded);
 	} else {
+#ifdef	MR_DEBUG_LVAL_REP
+		printf("looking up short lval\n");
+#endif
 		*value = MR_lookup_short_lval_base(
 			MR_short_desc_var_locn(label_layout, i),
 			saved_regs, base_sp, base_curfr, &succeeded);
Index: runtime/mercury_stack_layout.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_stack_layout.h,v
retrieving revision 1.52
diff -u -b -r1.52 mercury_stack_layout.h
--- runtime/mercury_stack_layout.h	2001/06/02 09:35:03	1.52
+++ runtime/mercury_stack_layout.h	2001/12/07 07:02:26
@@ -373,7 +373,8 @@
 		(&MR_long_desc_var_locn((sll), MR_long_desc_var_count(sll)))
 #define	MR_short_desc_var_locn(sll, i)					    \
 		(((MR_uint_least8_t *)					    \
-			MR_end_of_long_desc_var_locns(sll))[(i)])
+			MR_end_of_long_desc_var_locns(sll))		    \
+		 		[(i - MR_long_desc_var_count(sll))])
 
 /*
 ** Define a stack layout for an internal label.
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
Index: tests/debugger/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/debugger/Mmakefile,v
retrieving revision 1.56
diff -u -b -r1.56 Mmakefile
--- tests/debugger/Mmakefile	2001/12/10 02:43:24	1.56
+++ tests/debugger/Mmakefile	2001/12/10 02:43:37
@@ -35,6 +35,7 @@
 	implied_instance		\
 	interpreter			\
 	loopcheck			\
+	lval_desc_array			\
 	multi_parameter			\
 	nondet_stack			\
 	output_term_dep			\
@@ -42,7 +43,6 @@
 	resume_typeinfos		\
 	shallow
 
-
 # The following tests are disabled, since currently they get some spurious
 # failures if readline support is enabled:
 #	interactive
@@ -207,6 +207,10 @@
 interpreter.out: interpreter interpreter.inp
 	$(MDB) ./interpreter interpreter.m < interpreter.inp \
 		> interpreter.out 2>&1
+
+lval_desc_array.out: lval_desc_array lval_desc_array.inp
+	$(MDB) ./lval_desc_array < lval_desc_array.inp \
+		> lval_desc_array.out 2>&1
 
 # We need to pipe the output through sed to avoid hard-coding dependencies on
 # particular line numbers in the standard library source code.
Index: tests/debugger/lval_desc_array.exp
===================================================================
RCS file: lval_desc_array.exp
diff -N lval_desc_array.exp
--- /dev/null	Fri Dec  1 02:25:58 2000
+++ lval_desc_array.exp	Sat Dec  8 09:43:09 2001
@@ -0,0 +1,122 @@
+       1:      1  1 CALL pred lval_desc_array:main/2-0 (det) lval_desc_array.m:17
+mdb> echo on
+Command echo enabled.
+mdb> context none
+Contexts will not be printed.
+mdb> register --quiet
+mdb> goto 218
+     218:    110  3 EXIT pred lval_desc_array:increment/2-0 (det)
+mdb> up 1
+Ancestor level set to 1:
+   1  pred lval_desc_array:perform_increments/2-0 (det)
+mdb> print *
+       HeadVar__1             	0
+       DCG_1                  	1
+       DCG_2                  	2
+       DCG_3                  	3
+       DCG_4                  	4
+       DCG_5                  	5
+       DCG_6                  	6
+       DCG_7                  	7
+       DCG_8                  	8
+       DCG_9                  	9
+       DCG_10                 	10
+       DCG_11                 	11
+       DCG_12                 	12
+       DCG_13                 	13
+       DCG_14                 	14
+       DCG_15                 	15
+       DCG_16                 	16
+       DCG_17                 	17
+       DCG_18                 	18
+       DCG_19                 	19
+       DCG_20                 	20
+       DCG_21                 	21
+       DCG_22                 	22
+       DCG_23                 	23
+       DCG_24                 	24
+       DCG_25                 	25
+       DCG_26                 	26
+       DCG_27                 	27
+       DCG_28                 	28
+       DCG_29                 	29
+       DCG_30                 	30
+       DCG_31                 	31
+       DCG_32                 	32
+       DCG_33                 	33
+       DCG_34                 	34
+       DCG_35                 	35
+       DCG_36                 	36
+       DCG_37                 	37
+       DCG_38                 	38
+       DCG_39                 	39
+       DCG_40                 	40
+       DCG_41                 	41
+       DCG_42                 	42
+       DCG_43                 	43
+       DCG_44                 	44
+       DCG_45                 	45
+       DCG_46                 	46
+       DCG_47                 	47
+       DCG_48                 	48
+       DCG_49                 	49
+       DCG_50                 	50
+       DCG_51                 	51
+       DCG_52                 	52
+       DCG_53                 	53
+       DCG_54                 	54
+       DCG_55                 	55
+       DCG_56                 	56
+       DCG_57                 	57
+       DCG_58                 	58
+       DCG_59                 	59
+       DCG_60                 	60
+       DCG_61                 	61
+       DCG_62                 	62
+       DCG_63                 	63
+       DCG_64                 	64
+       DCG_65                 	65
+       DCG_66                 	66
+       DCG_67                 	67
+       DCG_68                 	68
+       DCG_69                 	69
+       DCG_70                 	70
+       DCG_71                 	71
+       DCG_72                 	72
+       DCG_73                 	73
+       DCG_74                 	74
+       DCG_75                 	75
+       DCG_76                 	76
+       DCG_77                 	77
+       DCG_78                 	78
+       DCG_79                 	79
+       DCG_80                 	80
+       DCG_81                 	81
+       DCG_82                 	82
+       DCG_83                 	83
+       DCG_84                 	84
+       DCG_85                 	85
+       DCG_86                 	86
+       DCG_87                 	87
+       DCG_88                 	88
+       DCG_89                 	89
+       DCG_90                 	90
+       DCG_91                 	91
+       DCG_92                 	92
+       DCG_93                 	93
+       DCG_94                 	94
+       DCG_95                 	95
+       DCG_96                 	96
+       DCG_97                 	97
+       DCG_98                 	98
+       DCG_99                 	99
+       DCG_100                	100
+       DCG_101                	101
+       DCG_102                	102
+       DCG_103                	103
+       DCG_104                	104
+       DCG_105                	105
+       DCG_106                	106
+       DCG_107                	107
+mdb> continue
+108
Index: tests/debugger/lval_desc_array.exp2
===================================================================
RCS file: lval_desc_array.exp2
diff -N lval_desc_array.exp2
--- /dev/null	Fri Dec  1 02:25:58 2000
+++ lval_desc_array.exp2	Sat Dec  8 09:13:40 2001
@@ -0,0 +1,122 @@
+       1:      1  1 CALL pred lval_desc_array:main/2-0 (det) lval_desc_array.m:17
+mdb> echo on
+Command echo enabled.
+mdb> context none
+Contexts will not be printed.
+mdb> register --quiet
+mdb> goto 218
+     218:    110  3 EXIT pred lval_desc_array:increment/2-0 (det)
+mdb> up 1
+Ancestor level set to 1:
+   1  pred lval_desc_array:perform_increments/2-0 (det)
+mdb> print *
+       HeadVar__1             	0
+       DCG_1                  	1
+       DCG_2                  	2
+       DCG_3                  	3
+       DCG_4                  	4
+       DCG_5                  	5
+       DCG_6                  	6
+       DCG_7                  	7
+       DCG_8                  	8
+       DCG_9                  	9
+       DCG_10                 	10
+       DCG_11                 	11
+       DCG_12                 	12
+       DCG_13                 	13
+       DCG_14                 	14
+       DCG_15                 	15
+       DCG_16                 	16
+       DCG_17                 	17
+       DCG_18                 	18
+       DCG_19                 	19
+       DCG_20                 	20
+       DCG_21                 	21
+       DCG_22                 	22
+       DCG_23                 	23
+       DCG_24                 	24
+       DCG_25                 	25
+       DCG_26                 	26
+       DCG_27                 	27
+       DCG_28                 	28
+       DCG_29                 	29
+       DCG_30                 	30
+       DCG_31                 	31
+       DCG_32                 	32
+       DCG_33                 	33
+       DCG_34                 	34
+       DCG_35                 	35
+       DCG_36                 	36
+       DCG_37                 	37
+       DCG_38                 	38
+       DCG_39                 	39
+       DCG_40                 	40
+       DCG_41                 	41
+       DCG_42                 	42
+       DCG_43                 	43
+       DCG_44                 	44
+       DCG_45                 	45
+       DCG_46                 	46
+       DCG_47                 	47
+       DCG_48                 	48
+       DCG_49                 	49
+       DCG_50                 	50
+       DCG_51                 	51
+       DCG_52                 	52
+       DCG_53                 	53
+       DCG_54                 	54
+       DCG_55                 	55
+       DCG_56                 	56
+       DCG_57                 	57
+       DCG_58                 	58
+       DCG_59                 	59
+       DCG_60                 	60
+       DCG_61                 	61
+       DCG_62                 	62
+       DCG_63                 	63
+       DCG_64                 	64
+       DCG_65                 	65
+       DCG_66                 	66
+       DCG_67                 	67
+       DCG_68                 	68
+       DCG_69                 	69
+       DCG_70                 	70
+       DCG_71                 	71
+       DCG_72                 	72
+       DCG_73                 	73
+       DCG_74                 	74
+       DCG_75                 	75
+       DCG_76                 	76
+       DCG_77                 	77
+       DCG_78                 	78
+       DCG_79                 	79
+       DCG_80                 	80
+       DCG_81                 	81
+       DCG_82                 	82
+       DCG_83                 	83
+       DCG_84                 	84
+       DCG_85                 	85
+       DCG_86                 	86
+       DCG_87                 	87
+       DCG_88                 	88
+       DCG_89                 	89
+       DCG_90                 	90
+       DCG_91                 	91
+       DCG_92                 	92
+       DCG_93                 	93
+       DCG_94                 	94
+       DCG_95                 	95
+       DCG_96                 	96
+       DCG_97                 	97
+       DCG_98                 	98
+       DCG_99                 	99
+       DCG_100                	100
+       DCG_101                	101
+       DCG_102                	102
+       DCG_103                	103
+       DCG_104                	104
+       DCG_105                	105
+       DCG_106                	106
+       DCG_107                	107
+mdb> continue
+108
Index: tests/debugger/lval_desc_array.inp
===================================================================
RCS file: lval_desc_array.inp
diff -N lval_desc_array.inp
--- /dev/null	Fri Dec  1 02:25:58 2000
+++ lval_desc_array.inp	Sat Dec  8 09:10:37 2001
@@ -0,0 +1,7 @@
+echo on
+context none
+register --quiet
+goto 218
+up 1
+print *
+continue
Index: tests/debugger/lval_desc_array.m
===================================================================
RCS file: lval_desc_array.m
diff -N lval_desc_array.m
--- /dev/null	Fri Dec  1 02:25:58 2000
+++ lval_desc_array.m	Fri Dec  7 18:03:23 2001
@@ -0,0 +1,49 @@
+% This program tests whether the debugger is able to properly handle
+% label layout structures which have variables whose locations (lvals)
+% use long as well as short encodings.
+
+:- module lval_desc_array.
+
+:- interface.
+
+:- import_module io.
+
+:- pred main(io__state::di, io__state::uo) is det.
+
+:- implementation.
+
+:- import_module int.
+
+main -->
+	{ A0 = 0 },
+	{ perform_increments(A0, A) },
+	io__write_int(A),
+	io__write_string("\n").
+
+:- pred perform_increments(int::in, int::out) is det.
+
+perform_increments -->
+	increment, increment, increment, increment, increment, increment,
+	increment, increment, increment, increment, increment, increment,
+	increment, increment, increment, increment, increment, increment,
+	increment, increment, increment, increment, increment, increment,
+	increment, increment, increment, increment, increment, increment,
+	increment, increment, increment, increment, increment, increment,
+	increment, increment, increment, increment, increment, increment,
+	increment, increment, increment, increment, increment, increment,
+	increment, increment, increment, increment, increment, increment,
+	increment, increment, increment, increment, increment, increment,
+	increment, increment, increment, increment, increment, increment,
+	increment, increment, increment, increment, increment, increment,
+	increment, increment, increment, increment, increment, increment,
+	increment, increment, increment, increment, increment, increment,
+	increment, increment, increment, increment, increment, increment,
+	increment, increment, increment, increment, increment, increment,
+	increment, increment, increment, increment, increment, increment,
+	increment, increment, increment, increment, increment, increment.
+
+:- pragma no_inline(increment/2).
+
+:- pred increment(int::in, int::out) is det.
+
+increment(N, N + 1).
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
Index: trace/mercury_trace_vars.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace_vars.c,v
retrieving revision 1.27
diff -u -b -r1.27 mercury_trace_vars.c
--- trace/mercury_trace_vars.c	2001/12/04 00:44:40	1.27
+++ trace/mercury_trace_vars.c	2001/12/09 01:48:24
@@ -701,11 +701,13 @@
 	if (MR_trace_is_number(word_spec, &n)) {
 		var_spec.MR_var_spec_kind = MR_VAR_SPEC_NUMBER;
 		var_spec.MR_var_spec_number = n;
+		var_spec.MR_var_spec_name = NULL; /* unused */
 		return MR_trace_browse_one_path(out, var_spec, path,
 			browser, caller, format, must_be_unique);
 	} else {
 		var_spec.MR_var_spec_kind = MR_VAR_SPEC_NAME;
 		var_spec.MR_var_spec_name = word_spec;
+		var_spec.MR_var_spec_number = -1; /* unused */
 		return MR_trace_browse_one_path(out, var_spec, path,
 			browser, caller, format, must_be_unique);
 	}
cvs diff: Diffing util
--------------------------------------------------------------------------
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