Mercury Bugs - mercury
View Issue Details
0000218mercuryBugpublic2011-09-26 08:412011-09-26 09:52
Assigned To 
PrioritylowSeverityfeatureReproducibilityhave not tried
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000218: Feature request: mdb commands for working with common data structures.
DescriptionOften when using the degger I'd like to know something about a data structure.

browser> print
proc_info(context("mandelbrot.m", 279),
    map([(var(1) -> "TypeInfo_for_X"), (var(2) -> "TypeInfo_for_Y"),
      (... -> ...), ...]), map([])),
    (var(1) ->
      defined_type(qualified(unqualified("private_builtin"), "type_info"), [],
        kind_star)), (var(2) -> defined_type(qualified(...), ...)),
    (var(...) -> ...), ..., ...]), [var(21), var(22), var(...), ...],
  varset(var_supply(0), map([]), map([])),
  yes([(ground(...) -> ...), ..., ...]),
  [user_defined_mode(qualified(...), ...), ..., ...], no, no, ...)
browser> cd 3
browser> print
  (var(1) ->
    defined_type(qualified(unqualified("private_builtin"), "type_info"), [],
  (var(2) ->
    defined_type(qualified(unqualified("private_builtin"), "type_info"), [],
  (var(3) -> defined_type(qualified(unqualified(...), ...), [], ...)),
  (var(4) -> higher_order_type(...)), (... -> ...), ...])

What I want to know at this point is var(21) present in this map and what is it's value.

It'd be nice to have commands to work with maps, sets, lists, and perhaps other commonly-used data-structures to anwser these questions. This should be without
using the clunky compile a .m file and dynamically load it into the binary being debugged operation.
TagsNo tags attached.
Attached Files

2011-09-26 09:32   
Just wanted to check if you're aware of the 'open' command. This opens a given term in your editor. I generally find this sufficient for checking whether data structures contain particular values.
2011-09-26 09:52   
That's helpful, but not perfect.

It won't open subterms for me, such as "open 5/6"

Instead I have to match parens (vim helps) and count.

Issue History
2011-09-26 08:41pboneNew Issue
2011-09-26 09:32maclartyNote Added: 0000361
2011-09-26 09:52pboneNote Added: 0000362