llvm-project/lldb
Dave Lee 185d4964a1 [lldb] Introduce dwim-print command
Implements `dwim-print`, a printing command that chooses the most direct,
efficient, and resilient means of printing a given expression.

DWIM is an acronym for Do What I Mean. From Wikipedia, DWIM is described as:

  > attempt to anticipate what users intend to do, correcting trivial errors
  > automatically rather than blindly executing users' explicit but
  > potentially incorrect input

The `dwim-print` command serves as a single print command for users who don't
yet know, or prefer not to know, the various lldb commands that can be used to
print, and when to use them.

This initial implementation is the base foundation for `dwim-print`. It accepts
no flags, only an expression. If the expression is the name of a variable in
the frame, then effectively `frame variable` is used to get, and print, its
value. Otherwise, printing falls back to using `expression` evaluation. In this
initial version, frame variable paths will be handled with `expression`.

Following this, there are a number of improvements that can be made. Some
improvements include supporting `frame variable` expressions or registers.

To provide transparency, especially as the `dwim-print` command evolves, a new
setting is also introduced: `dwim-print-verbosity`. This setting instructs
`dwim-print` to optionally print a message showing the effective command being
run. For example `dwim-print var.meth()` can print a message such as: "note:
ran `expression var.meth()`".

See https://discourse.llvm.org/t/dwim-print-command/66078 for the proposal and
discussion.

Differential Revision: https://reviews.llvm.org/D138315
2022-11-29 12:46:20 -08:00
..
bindings [NFC] Make headers self-contained. 2022-11-29 04:14:55 -08:00
cmake [lldb] Make SWIG an auto-detected dependency 2022-11-29 09:07:11 -08:00
docs [lldb] Make callback-based formatter matching available from the CLI. 2022-11-10 10:29:38 -08:00
examples [lldb/Plugins] Improve error reporting with reading memory in Scripted Process 2022-11-18 13:56:48 -08:00
include/lldb [lldb] Introduce dwim-print command 2022-11-29 12:46:20 -08:00
packages/Python/lldbsuite [lldb/test] Use SBPlatform info for lldbplatformutil.getPlatform() 2022-11-29 11:29:58 +01:00
resources
scripts
source [lldb] Introduce dwim-print command 2022-11-29 12:46:20 -08:00
test [lldb] Introduce dwim-print command 2022-11-29 12:46:20 -08:00
third_party/Python/module [lldb] Remove uses of six module (NFC) 2022-08-11 19:06:15 -07:00
tools Change debugserver to spawn processes in their own pgrp 2022-11-24 10:59:12 -08:00
unittests [lldb] Fix PathMappingListTest for the Optional interface change 2022-11-24 11:11:05 +01:00
utils [test] Fix LLDB tests with just-built libcxx when using a target directory. 2022-10-26 12:07:22 -07:00
.clang-format
.clang-tidy
.gitignore
CMakeLists.txt [lldb] Restore default setting of LLDB_INCLUDE_TESTS in standalone builds 2022-11-18 09:05:08 -08:00
CODE_OWNERS.txt
LICENSE.TXT
use_lldb_suite_root.py