mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-20 20:03:44 +00:00
Estimated hours taken: 3 Record the trace level that the module was compiled with in the module layout structure. Use this to avoid an abort if the 'dd' command is used on a module that is compiled with trace level 'deep'. compiler/trace_params.m: Encode the trace level as an integer. runtime/mercury_stack_layout.h: Add a field to MR_Module_Layout to store the encoded trace level. compiler/stack_layout.m: Fill in this field. trace/mercury_trace_declarative.c: Ignore events from modules that don't have an appropriate trace level. This effectively assumes that the events are correct, so we warn the user that this has happened. Also, disallow the 'dd' command at these events. tests/debugger/declarative/Mmakefile: tests/debugger/declarative/deep_sub.m: tests/debugger/declarative/deep_warning.exp: tests/debugger/declarative/deep_warning.inp: tests/debugger/declarative/deep_warning.m: A test case for the new feature.
34 lines
1.4 KiB
Plaintext
34 lines
1.4 KiB
Plaintext
1: 1 1 CALL pred deep_warning:main/2-0 (det) deep_warning.m:8
|
|
mdb> echo on
|
|
Command echo enabled.
|
|
mdb> register --quiet
|
|
mdb> break p
|
|
0: + stop interface pred deep_warning:p/2-0 (nondet)
|
|
mdb> break q
|
|
1: + stop interface pred deep_sub:q/1-0 (multi)
|
|
mdb> continue
|
|
3: 2 2 CALL pred deep_warning:p/2-0 (nondet) deep_warning.m:28 (deep_warning.m:10)
|
|
mdb> finish
|
|
5: 3 3 CALL pred deep_sub:q/1-0 (multi) deep_sub.m:5 (deep_warning.m:29)
|
|
7: 3 3 EXIT pred deep_sub:q/1-0 (multi) deep_sub.m:5 (deep_warning.m:29)
|
|
8: 2 2 EXIT pred deep_warning:p/2-0 (nondet) deep_warning.m:28 (deep_warning.m:10)
|
|
mdb> dd
|
|
Warning: some modules were compiled with a trace level lower than `decl'.
|
|
This may result in calls being omitted from the debugging tree.
|
|
p(1, 1)
|
|
Valid? no
|
|
Found incorrect contour:
|
|
p(1, 1)
|
|
Is this a bug? yes
|
|
8: 2 2 EXIT pred deep_warning:p/2-0 (nondet) deep_warning.m:28 (deep_warning.m:10)
|
|
mdb> retry
|
|
3: 2 2 CALL pred deep_warning:p/2-0 (nondet) deep_warning.m:28 (deep_warning.m:10)
|
|
mdb> continue
|
|
5: 3 3 CALL pred deep_sub:q/1-0 (multi) deep_sub.m:5 (deep_warning.m:29)
|
|
mdb> finish
|
|
7: 3 3 EXIT pred deep_sub:q/1-0 (multi) deep_sub.m:5 (deep_warning.m:29)
|
|
mdb> dd
|
|
mdb: cannot start declarative debugging, because this procedure was not
|
|
compiled with trace level `decl'.
|
|
mdb> quit -y
|