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 // C Includes 14 // C++ Includes 15 // Other libraries and framework includes 16 // Project includes 17 #include "lldb/Core/ArchSpec.h" 18 #include "lldb/Interpreter/CommandObject.h" 19 #include "lldb/Interpreter/Options.h" 20 21 namespace lldb_private { 22 23 //------------------------------------------------------------------------- 24 // CommandObjectDisassemble 25 //------------------------------------------------------------------------- 26 27 class CommandObjectDisassemble : public CommandObjectParsed 28 { 29 public: 30 class CommandOptions : public Options 31 { 32 public: 33 34 CommandOptions (CommandInterpreter &interpreter); 35 36 virtual 37 ~CommandOptions (); 38 39 virtual Error 40 SetOptionValue (uint32_t option_idx, const char *option_arg); 41 42 void 43 OptionParsingStarting (); 44 45 const OptionDefinition* 46 GetDefinitions (); 47 48 const char * 49 GetPluginName () 50 { 51 if (plugin_name.empty()) 52 return NULL; 53 return plugin_name.c_str(); 54 } 55 56 virtual Error 57 OptionParsingFinished (); 58 59 bool show_mixed; // Show mixed source/assembly 60 bool show_bytes; 61 uint32_t num_lines_context; 62 uint32_t num_instructions; 63 bool raw; 64 std::string func_name; 65 bool current_function; 66 lldb::addr_t start_addr; 67 lldb::addr_t end_addr; 68 bool at_pc; 69 bool frame_line; 70 std::string plugin_name; 71 ArchSpec arch; 72 bool some_location_specified; // If no location was specified, we'll select "at_pc". This should be set 73 // in SetOptionValue if anything the selects a location is set. 74 static OptionDefinition g_option_table[]; 75 }; 76 77 CommandObjectDisassemble (CommandInterpreter &interpreter); 78 79 virtual 80 ~CommandObjectDisassemble (); 81 82 virtual 83 Options * 84 GetOptions () 85 { 86 return &m_options; 87 } 88 89 protected: 90 virtual bool 91 DoExecute (Args& command, 92 CommandReturnObject &result); 93 94 CommandOptions m_options; 95 96 }; 97 98 } // namespace lldb_private 99 100 #endif // liblldb_CommandObjectDisassemble_h_ 101