1 //===-- CommandObjectDWIMPrint.h --------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_SOURCE_COMMANDS_COMMANDOBJECTDWIMPRINT_H
10 #define LLDB_SOURCE_COMMANDS_COMMANDOBJECTDWIMPRINT_H
11 
12 #include "lldb/Interpreter/CommandObject.h"
13 
14 namespace lldb_private {
15 
16 /// Implements `dwim-print`, a printing command that chooses the most direct,
17 /// efficient, and resilient means of printing a given expression.
18 ///
19 /// DWIM is an acronym for Do What I Mean. From Wikipedia, DWIM is described as:
20 ///
21 ///   > attempt to anticipate what users intend to do, correcting trivial errors
22 ///   > automatically rather than blindly executing users' explicit but
23 ///   > potentially incorrect input
24 ///
25 /// The `dwim-print` command serves as a single print command for users who
26 /// don't yet know, or perfer not to know, the various lldb commands that can be
27 /// used to print, and when to use them.
28 class CommandObjectDWIMPrint : public CommandObjectRaw {
29 public:
30   CommandObjectDWIMPrint(CommandInterpreter &interpreter);
31 
32   ~CommandObjectDWIMPrint() override = default;
33 
34 private:
35   bool DoExecute(llvm::StringRef command, CommandReturnObject &result) override;
36 };
37 
38 } // namespace lldb_private
39 
40 #endif
41