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_
15 // Other libraries and framework includes
17 #include "lldb/Core/ArchSpec.h"
18 #include "lldb/Interpreter/CommandObject.h"
19 #include "lldb/Interpreter/Options.h"
21 namespace lldb_private {
23 //-------------------------------------------------------------------------
24 // CommandObjectDisassemble
25 //-------------------------------------------------------------------------
27 class CommandObjectDisassemble : public CommandObjectParsed {
29 class CommandOptions : public Options {
33 ~CommandOptions() override;
35 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
36 ExecutionContext *execution_context) override;
38 void OptionParsingStarting(ExecutionContext *execution_context) override;
40 llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
42 const char *GetPluginName() {
43 return (plugin_name.empty() ? nullptr : plugin_name.c_str());
46 const char *GetFlavorString() {
47 if (flavor_string.empty() || flavor_string == "default")
49 return flavor_string.c_str();
52 Status OptionParsingFinished(ExecutionContext *execution_context) override;
54 bool show_mixed; // Show mixed source/assembly
56 uint32_t num_lines_context;
57 uint32_t num_instructions;
59 std::string func_name;
60 bool current_function;
61 lldb::addr_t start_addr;
62 lldb::addr_t end_addr;
65 std::string plugin_name;
66 std::string flavor_string;
68 bool some_location_specified; // If no location was specified, we'll select
69 // "at_pc". This should be set
70 // in SetOptionValue if anything the selects a location is set.
71 lldb::addr_t symbol_containing_addr;
72 static OptionDefinition g_option_table[];
75 CommandObjectDisassemble(CommandInterpreter &interpreter);
77 ~CommandObjectDisassemble() override;
79 Options *GetOptions() override { return &m_options; }
82 bool DoExecute(Args &command, CommandReturnObject &result) override;
84 CommandOptions m_options;
87 } // namespace lldb_private
89 #endif // liblldb_CommandObjectDisassemble_h_