1 //===-- CommandObjectDisassemble.h ------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #ifndef liblldb_CommandObjectDisassemble_h_ 11 #define liblldb_CommandObjectDisassemble_h_ 12 13 #include "lldb/Interpreter/CommandObject.h" 14 #include "lldb/Interpreter/Options.h" 15 #include "lldb/Utility/ArchSpec.h" 16 17 namespace lldb_private { 18 19 //------------------------------------------------------------------------- 20 // CommandObjectDisassemble 21 //------------------------------------------------------------------------- 22 23 class CommandObjectDisassemble : public CommandObjectParsed { 24 public: 25 class CommandOptions : public Options { 26 public: 27 CommandOptions(); 28 29 ~CommandOptions() override; 30 31 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, 32 ExecutionContext *execution_context) override; 33 34 void OptionParsingStarting(ExecutionContext *execution_context) override; 35 36 llvm::ArrayRef<OptionDefinition> GetDefinitions() override; 37 GetPluginName()38 const char *GetPluginName() { 39 return (plugin_name.empty() ? nullptr : plugin_name.c_str()); 40 } 41 GetFlavorString()42 const char *GetFlavorString() { 43 if (flavor_string.empty() || flavor_string == "default") 44 return nullptr; 45 return flavor_string.c_str(); 46 } 47 48 Status OptionParsingFinished(ExecutionContext *execution_context) override; 49 50 bool show_mixed; // Show mixed source/assembly 51 bool show_bytes; 52 uint32_t num_lines_context; 53 uint32_t num_instructions; 54 bool raw; 55 std::string func_name; 56 bool current_function; 57 lldb::addr_t start_addr; 58 lldb::addr_t end_addr; 59 bool at_pc; 60 bool frame_line; 61 std::string plugin_name; 62 std::string flavor_string; 63 ArchSpec arch; 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 }; 69 70 CommandObjectDisassemble(CommandInterpreter &interpreter); 71 72 ~CommandObjectDisassemble() override; 73 GetOptions()74 Options *GetOptions() override { return &m_options; } 75 76 protected: 77 bool DoExecute(Args &command, CommandReturnObject &result) override; 78 79 CommandOptions m_options; 80 }; 81 82 } // namespace lldb_private 83 84 #endif // liblldb_CommandObjectDisassemble_h_ 85