mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 09:23:44 +00:00
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:
28
tests/debugger/lambda_expr.exp
Normal file
28
tests/debugger/lambda_expr.exp
Normal 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
|
||||
Reference in New Issue
Block a user