1 //===-- CommandObjectDisassemble.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 liblldb_CommandObjectDisassemble_h_
10 #define liblldb_CommandObjectDisassemble_h_
12 #include "lldb/Interpreter/CommandObject.h"
13 #include "lldb/Interpreter/Options.h"
14 #include "lldb/Utility/ArchSpec.h"
16 namespace lldb_private
{
18 // CommandObjectDisassemble
20 class CommandObjectDisassemble
: public CommandObjectParsed
{
22 class CommandOptions
: public Options
{
26 ~CommandOptions() override
;
28 Status
SetOptionValue(uint32_t option_idx
, llvm::StringRef option_arg
,
29 ExecutionContext
*execution_context
) override
;
31 void OptionParsingStarting(ExecutionContext
*execution_context
) override
;
33 llvm::ArrayRef
<OptionDefinition
> GetDefinitions() override
;
35 const char *GetPluginName() {
36 return (plugin_name
.empty() ? nullptr : plugin_name
.c_str());
39 const char *GetFlavorString() {
40 if (flavor_string
.empty() || flavor_string
== "default")
42 return flavor_string
.c_str();
45 Status
OptionParsingFinished(ExecutionContext
*execution_context
) override
;
47 bool show_mixed
; // Show mixed source/assembly
49 uint32_t num_lines_context
;
50 uint32_t num_instructions
;
52 std::string func_name
;
53 bool current_function
;
54 lldb::addr_t start_addr
;
55 lldb::addr_t end_addr
;
58 std::string plugin_name
;
59 std::string flavor_string
;
61 bool some_location_specified
; // If no location was specified, we'll select
62 // "at_pc". This should be set
63 // in SetOptionValue if anything the selects a location is set.
64 lldb::addr_t symbol_containing_addr
;
67 CommandObjectDisassemble(CommandInterpreter
&interpreter
);
69 ~CommandObjectDisassemble() override
;
71 Options
*GetOptions() override
{ return &m_options
; }
74 bool DoExecute(Args
&command
, CommandReturnObject
&result
) override
;
76 CommandOptions m_options
;
79 } // namespace lldb_private
81 #endif // liblldb_CommandObjectDisassemble_h_