[lldb] Make callback-based formatter matching available from the CLI.
authorJorge Gorbe Moya <jgorbe@google.com>
Thu, 10 Nov 2022 18:25:04 +0000 (10:25 -0800)
committerJorge Gorbe Moya <jgorbe@google.com>
Thu, 10 Nov 2022 18:29:38 +0000 (10:29 -0800)
commit868186cf6cb7edba08c916f98f5f87a942bf50ba
tree866b8398ea2f334278aef1a4432d3659d6224621
parenta2a4ccd54706e1ebbb0a1f98fc71bd1ef1e06a34
[lldb] Make callback-based formatter matching available from the CLI.

This change adds a `--recognizer-function` (`-R`) to `type summary add`
and `type synth add` that allows users to specify that the names in
the command are not type names but python function names.

It also adds an example to lldb/examples, and a section in the data
formatters documentation on how to use recognizer functions.

Differential Revision: https://reviews.llvm.org/D137000
lldb/docs/use/variable.rst
lldb/examples/synthetic/recognizer_function/example.py [new file with mode: 0644]
lldb/examples/synthetic/recognizer_function/lldb-commands [new file with mode: 0644]
lldb/examples/synthetic/recognizer_function/program.cpp [new file with mode: 0644]
lldb/source/Commands/CommandObjectType.cpp
lldb/source/Commands/Options.td
lldb/test/API/functionalities/data-formatter/callback-matching/TestDataFormatterCallbackMatching.py
lldb/test/API/functionalities/data-formatter/callback-matching/formatters_with_callback.py