mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-16 01:43:35 +00:00
browser/declarative_oracle.m:
Optimize table lookups when checking whether a procedure is trusted.
Instead of doing three separate lookups to test
- whether the module in which the procedure is in is trusted,
- whether the Mercury standard library is trusted, and this module
is in the Mercury standard library, and
- whether the predicate or function the procedure is in is trusted,
look up the module the procedure is in just once, then
- replace both of the first two lookups above with testing a single flag
each, and then
- look up the procedure in a map of trusted predicate or function names.
The last test should be faster than its old equivalent, because the map
it searches will be local to the module, whereas it used to be global.
Print the list of trusted entities (which this module calls trusted
"objects") in the same order regardless of whether we are printing
for users or as commands. The order will be the order in which they were
trusted.
Undo an unnecessary capitalization in the list of trusted objects.
browser/declarative_debugger.m:
Improve the style of some related code.
tests/debugger/save.exp:
tests/declarative_debugger/skip.exp:
tests/declarative_debugger/trust.exp:
Expect the changes described above in the list of trusted objects.
117 lines
2.0 KiB
Plaintext
117 lines
2.0 KiB
Plaintext
E1: C1 CALL pred skip.main/2-0 (det) skip.m:17
|
|
mdb> mdb> Contexts will not be printed.
|
|
mdb> echo on
|
|
Command echo enabled.
|
|
mdb> step
|
|
E2: C2 CALL pred skip.a/2-0 (det)
|
|
mdb> finish
|
|
E3: C2 EXIT pred skip.a/2-0 (det)
|
|
mdb> dd -d 3 -n 7
|
|
a(1, 70)
|
|
Valid? skip
|
|
b(1, 70)
|
|
Valid? y
|
|
c(70, 70)
|
|
Valid? y
|
|
d(70, 70)
|
|
Valid? y
|
|
a(1, 70)
|
|
Valid? n
|
|
Found incorrect contour:
|
|
b(1, 70)
|
|
c(70, 70)
|
|
d(70, 70)
|
|
a(1, 70)
|
|
Is this a bug? y
|
|
E3: C2 EXIT pred skip.a/2-0 (det)
|
|
mdb> trust b
|
|
Trusting pred skip.b/2
|
|
mdb> trust d
|
|
Trusting pred skip.d/2
|
|
mdb> step
|
|
E4: C3 CALL pred skip.a/2-0 (det)
|
|
mdb> finish
|
|
E5: C3 EXIT pred skip.a/2-0 (det)
|
|
mdb> dd -d 3 -n 7
|
|
a(2, 71)
|
|
Valid? skip
|
|
c(71, 71)
|
|
Valid? skip
|
|
e(71, 71)
|
|
Valid? n
|
|
Found incorrect contour:
|
|
e(71, 71)
|
|
Is this a bug? y
|
|
E6: C4 EXIT pred skip.e/2-0 (det)
|
|
mdb> untrust 1
|
|
mdb> untrust 2
|
|
mdb> trusted
|
|
Trusted objects:
|
|
0: the Mercury standard library
|
|
mdb> break a
|
|
0: + stop interface pred skip.a/2-0 (det)
|
|
mdb> continue
|
|
E5: C3 EXIT pred skip.a/2-0 (det)
|
|
mdb> step
|
|
E7: C5 CALL pred skip.a/2-0 (det)
|
|
mdb> finish
|
|
E8: C5 EXIT pred skip.a/2-0 (det)
|
|
mdb> dd -d 3 -n 7
|
|
a(3, 72)
|
|
Valid? n
|
|
b(3, 72)
|
|
Valid? y
|
|
c(72, 72)
|
|
Valid? n
|
|
e(72, 72)
|
|
Valid?
|
|
f(72, 72)
|
|
Valid?
|
|
e(72, 72)
|
|
Valid? skip
|
|
f(72, 72)
|
|
Valid? y
|
|
e(72, 72)
|
|
Valid? y
|
|
Found incorrect contour:
|
|
e(72, 72)
|
|
f(72, 72)
|
|
c(72, 72)
|
|
Is this a bug? y
|
|
E9: C6 EXIT pred skip.c/2-0 (det)
|
|
mdb> dd -d 3 -n 7
|
|
c(72, 72)
|
|
Valid? [no] q
|
|
Diagnosis aborted.
|
|
E9: C6 EXIT pred skip.c/2-0 (det)
|
|
mdb> break a
|
|
1: + stop interface pred skip.a/2-0 (det)
|
|
mdb> c
|
|
E8: C5 EXIT pred skip.a/2-0 (det)
|
|
mdb> retry
|
|
E7: C5 CALL pred skip.a/2-0 (det)
|
|
mdb> f
|
|
E8: C5 EXIT pred skip.a/2-0 (det)
|
|
mdb> dd -d 3 -n 7
|
|
a(3, 72)
|
|
Valid? [no]
|
|
c(72, 72)
|
|
Valid? [no] y
|
|
d(72, 72)
|
|
Valid? n
|
|
Found incorrect contour:
|
|
d(72, 72)
|
|
Is this a bug? n
|
|
d(72, 72)
|
|
Valid? [no] skip
|
|
d(72, 72)
|
|
Valid? y
|
|
Found incorrect contour:
|
|
b(3, 72)
|
|
c(72, 72)
|
|
d(72, 72)
|
|
a(3, 72)
|
|
Is this a bug? y
|
|
E8: C5 EXIT pred skip.a/2-0 (det)
|
|
mdb> quit -y
|