1 //===-- CommandObjectDisassemble.h ------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_CommandObjectDisassemble_h_
11 #define liblldb_CommandObjectDisassemble_h_
13 #include "lldb/Interpreter/CommandObject.h"
14 #include "lldb/Interpreter/Options.h"
15 #include "lldb/Utility/ArchSpec.h"
17 namespace lldb_private {
19 //-------------------------------------------------------------------------
20 // CommandObjectDisassemble
21 //-------------------------------------------------------------------------
23 class CommandObjectDisassemble : public CommandObjectParsed {
25 class CommandOptions : public Options {
29 ~CommandOptions() override;
31 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
32 ExecutionContext *execution_context) override;
34 void OptionParsingStarting(ExecutionContext *execution_context) override;
36 llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
38 const char *GetPluginName() {
39 return (plugin_name.empty() ? nullptr : plugin_name.c_str());
42 const char *GetFlavorString() {
43 if (flavor_string.empty() || flavor_string == "default")
45 return flavor_string.c_str();
48 Status OptionParsingFinished(ExecutionContext *execution_context) override;
50 bool show_mixed; // Show mixed source/assembly
52 uint32_t num_lines_context;
53 uint32_t num_instructions;
55 std::string func_name;
56 bool current_function;
57 lldb::addr_t start_addr;
58 lldb::addr_t end_addr;
61 std::string plugin_name;
62 std::string flavor_string;
64 bool some_location_specified; // If no location was specified, we'll select
65 // "at_pc". This should be set
66 // in SetOptionValue if anything the selects a location is set.
67 lldb::addr_t symbol_containing_addr;
68 static OptionDefinition g_option_table[];
71 CommandObjectDisassemble(CommandInterpreter &interpreter);
73 ~CommandObjectDisassemble() override;
75 Options *GetOptions() override { return &m_options; }
78 bool DoExecute(Args &command, CommandReturnObject &result) override;
80 CommandOptions m_options;
83 } // namespace lldb_private
85 #endif // liblldb_CommandObjectDisassemble_h_