Fix a problem reported by Ian: the debugger ignored information about the head

Estimated hours taken: 2
Branches: main

Fix a problem reported by Ian: the debugger ignored information about the head
variables of the predicates generated by the compiler from lambda expressions
because they didn't have names.

compiler/hlds_pred.m:
	Add a predicate to ensure that all headvars have names.

compiler/lambda.m:
	Call that predicate to give names to the predicates created from lambda
	expressions.

compiler/code_gen.m:
	Call that predicate to give names to the predicates created from lambda
	expressions, in case other transformations also create predicates
	with unnamed head variables.

doc/user_guide.texi:
	Add a new mdb command, var_details, and a new method of invocation of
	an existing mdb command, flag. I used them to track down this bug.

trace/mercury_trace_internal.c:
	Implement the var_details mdb command, and the new method of invocation
	of the flag command.

trace/mercury_trace_vars.[ch]:
	Add a function to print variable details.

tests/debugger/mdb_command_test.inp:
	Test the documentation of the new command.

tests/debugger/completion.exp:
	Expect the new command.

tests/debugger/lambda_expr.{m,inp,exp}:
	Add the new test case to test for the bug.

tests/debugger/Mmakefile:
	Enable the new test case.
This commit is contained in:
Zoltan Somogyi
2004-07-19 03:37:55 +00:00
parent 86772706b2
commit f76c4823e5
13 changed files with 212 additions and 23 deletions

View File

@@ -0,0 +1,28 @@
E1: C1 1 CALL pred lambda_expr.main/2-0 (det) lambda_expr.m:17
mdb> echo on
Command echo enabled.
mdb> context none
Contexts will not be printed.
mdb> register --quiet
mdb> step
E2: C2 2 CALL pred lambda_expr.IntroducedFrom__pred__main__18__1/2-0 (det)
mdb> print
IntroducedFrom__pred__main__18__1(1, _)
mdb> up
Ancestor level set to 1:
1 pred lambda_expr.main/2-0 (det)
mdb> print P
P 'IntroducedFrom__pred__main__18__1'
mdb> finish ; print
E3: C2 2 EXIT pred lambda_expr.IntroducedFrom__pred__main__18__1/2-0 (det)
IntroducedFrom__pred__main__18__1(1, 2)
mdb> retry
E2: C2 2 CALL pred lambda_expr.IntroducedFrom__pred__main__18__1/2-0 (det)
mdb> print
IntroducedFrom__pred__main__18__1(1, _)
mdb> finish
E3: C2 2 EXIT pred lambda_expr.IntroducedFrom__pred__main__18__1/2-0 (det)
mdb> print
IntroducedFrom__pred__main__18__1(1, 2)
mdb> continue
2