mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-22 21:03:53 +00:00
Estimated hours taken: 12 Get the debugger to sort variables better. trace/mercury_trace_vars.[ch]: A new module to manage the debugger's information about the variables live at the current program point (which can be defined as the combination of a specific event and an ancestor level). This new module centralizes the management of the (sorted) list of current variables. This in turn allows us to use a better sorting method, one that orders VarName15 correctly wrt both VarName2 and VarName. The new module also uses the type, not the name, of a variable to decide whether to exclude it from the list of variables that may be presented to the user (e.g. if it is a typeinfo or a typeclassinfo). trace/mercury_trace_internal.c: trace/mercury_trace_external.c: Use the new module's facilities. This factors out some "mostly" common code. trace/Mmakefile: Add the new module. runtime/mercury_layout_util.[ch]: Remove the code recently moved here from trace/mercury_trace_internal, as well as the filtered versions of some functions, since they are not needed anymore. Move the code for MR_make_var_list to trace/mercury_trace_external, since that is the only place where it is used (or is at all likely to be used). Since its new home is next to several very similar functions, this should also reduce the probability that any required maintenance will be overlooked. Also alter its coding style to conform to its new neighbours. Move the definition of MR_Var_Spec to trace/mercury_trace_vars.h. tests/debugger/*.exp: Update the expected output files. In most cases, this is just because the new module outputs different white space, but in some cases, it also reflects that the debugger now prints variables in a different order.
55 lines
1.8 KiB
Plaintext
55 lines
1.8 KiB
Plaintext
1: 1 1 CALL pred debugger_regs:main/2-0 (det)
|
|
mdb> echo on
|
|
Command echo enabled.
|
|
mdb>
|
|
2: 2 2 CALL pred debugger_regs:data/41-0 (det)
|
|
mdb>
|
|
3: 2 2 EXIT pred debugger_regs:data/41-0 (det)
|
|
mdb> print *
|
|
HeadVar__1 [1, 2, 3, 4, 5]
|
|
HeadVar__2 "a0"
|
|
HeadVar__3 "a1"
|
|
HeadVar__4 "a2"
|
|
HeadVar__5 "a3"
|
|
HeadVar__6 "a4"
|
|
HeadVar__7 "a5"
|
|
HeadVar__8 "a6"
|
|
HeadVar__9 "a7"
|
|
HeadVar__10 "a8"
|
|
HeadVar__11 "a9"
|
|
HeadVar__12 "b0"
|
|
HeadVar__13 "b1"
|
|
HeadVar__14 "b2"
|
|
HeadVar__15 "b3"
|
|
HeadVar__16 "b4"
|
|
HeadVar__17 "b5"
|
|
HeadVar__18 "b6"
|
|
HeadVar__19 "b7"
|
|
HeadVar__20 "b8"
|
|
HeadVar__21 "b9"
|
|
HeadVar__22 "c0"
|
|
HeadVar__23 "c1"
|
|
HeadVar__24 "c2"
|
|
HeadVar__25 "c3"
|
|
HeadVar__26 "c4"
|
|
HeadVar__27 "c5"
|
|
HeadVar__28 "c6"
|
|
HeadVar__29 "c7"
|
|
HeadVar__30 "c8"
|
|
HeadVar__31 "c9"
|
|
HeadVar__32 "d0"
|
|
HeadVar__33 "d1"
|
|
HeadVar__34 "d2"
|
|
HeadVar__35 "d3"
|
|
HeadVar__36 "d4"
|
|
HeadVar__37 "d5"
|
|
HeadVar__38 "d6"
|
|
HeadVar__39 "d7"
|
|
HeadVar__40 "d8"
|
|
HeadVar__41 "d9"
|
|
mdb> continue
|
|
a0a1a2a3a4a5a6a7a8a9
|
|
b0b1b2b3b4b5b6b7b8b9
|
|
c0c1c2c3c4c5c6c7c8c9
|
|
d0d1d2d3d4d5d6d7d8d9
|