1 //===-- CommandObjectTrace.h ------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SOURCE_COMMANDS_COMMANDOBJECTTRACE_H
10 #define LLDB_SOURCE_COMMANDS_COMMANDOBJECTTRACE_H
12 #include "CommandObjectThreadUtil.h"
14 namespace lldb_private
{
16 class CommandObjectTrace
: public CommandObjectMultiword
{
18 CommandObjectTrace(CommandInterpreter
&interpreter
);
20 ~CommandObjectTrace() override
;
23 /// This class works by delegating the logic to the actual trace plug-in that
24 /// can support the current process.
25 class CommandObjectTraceProxy
: public CommandObjectProxy
{
27 CommandObjectTraceProxy(bool live_debug_session_only
,
28 CommandInterpreter
&interpreter
, const char *name
,
29 const char *help
= nullptr,
30 const char *syntax
= nullptr, uint32_t flags
= 0)
31 : CommandObjectProxy(interpreter
, name
, help
, syntax
, flags
),
32 m_live_debug_session_only(live_debug_session_only
) {}
35 virtual lldb::CommandObjectSP
GetDelegateCommand(Trace
&trace
) = 0;
37 llvm::Expected
<lldb::CommandObjectSP
> DoGetProxyCommandObject();
39 CommandObject
*GetProxyCommandObject() override
;
42 llvm::StringRef
GetUnsupportedError() override
{ return m_delegate_error
; }
44 bool m_live_debug_session_only
;
45 lldb::CommandObjectSP m_delegate_sp
;
46 std::string m_delegate_error
;
49 } // namespace lldb_private
51 #endif // LLDB_SOURCE_COMMANDS_COMMANDOBJECTTRACE_H