[Bug 17472] New: Summary strings should have a way to run expressions

Bug ID 17472
Summary Summary strings should have a way to run expressions
Product lldb
Version unspecified
Hardware All
OS All
Status NEW
Severity enhancement
Priority P
Component All Bugs
Assignee lldb-dev@cs.uiuc.edu
Reporter egranata@apple.com
Classification Unclassified

LLDB includes a summary string feature that one can use to provide a summary
for a data type by providing a string that is then formatted with a bunch of
escape sequences and rules. For instance "foo=${var.foo%x}” amounts to
displaying
foo=<value of child member foo formatted as a hex number>
when evaluated as a summary

This ER requests the addition of a syntax through which expressions can be run
in order to generate a summary. For instance, if my class has a function
getUsefulString(), one could want to vend a summary that displays the useful
string. Currently, Python summaries are the way to achieve that effect, but it
would be nice if one could simply say something like

${expr:$VAR.getUsefulString()}

The ${expr: / $VAR syntax is in no way mandatory, and simply an example of a
proposal. However a syntax that seamlessly blends in with the current ${…
format is certainly a plus

Bonus points if the implementation is able to recognize a Foo from a Foo* and
automagically do the right thing w.r.t. dot vs arrow