Path: blob/main/contrib/llvm-project/lldb/source/Commands/CommandObjectDWIMPrint.h
39587 views
//===-- CommandObjectDWIMPrint.h --------------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLDB_SOURCE_COMMANDS_COMMANDOBJECTDWIMPRINT_H9#define LLDB_SOURCE_COMMANDS_COMMANDOBJECTDWIMPRINT_H1011#include "CommandObjectExpression.h"12#include "lldb/Interpreter/CommandObject.h"13#include "lldb/Interpreter/OptionGroupFormat.h"14#include "lldb/Interpreter/OptionGroupValueObjectDisplay.h"15#include "lldb/Interpreter/OptionValueFormat.h"1617namespace lldb_private {1819/// Implements `dwim-print`, a printing command that chooses the most direct,20/// efficient, and resilient means of printing a given expression.21///22/// DWIM is an acronym for Do What I Mean. From Wikipedia, DWIM is described as:23///24/// > attempt to anticipate what users intend to do, correcting trivial errors25/// > automatically rather than blindly executing users' explicit but26/// > potentially incorrect input27///28/// The `dwim-print` command serves as a single print command for users who29/// don't yet know, or perfer not to know, the various lldb commands that can be30/// used to print, and when to use them.31class CommandObjectDWIMPrint : public CommandObjectRaw {32public:33CommandObjectDWIMPrint(CommandInterpreter &interpreter);3435~CommandObjectDWIMPrint() override = default;3637Options *GetOptions() override;3839bool WantsCompletion() override { return true; }4041private:42void DoExecute(llvm::StringRef command, CommandReturnObject &result) override;4344OptionGroupOptions m_option_group;45OptionGroupFormat m_format_options = lldb::eFormatDefault;46OptionGroupValueObjectDisplay m_varobj_options;47CommandObjectExpression::CommandOptions m_expr_options;48};4950} // namespace lldb_private5152#endif535455