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 const char * 57 GetFlavorString () 58 { 59 if (flavor_string.empty() || flavor_string == "default") 60 return NULL; 61 return flavor_string.c_str(); 62 } 63 64 virtual Error 65 OptionParsingFinished (); 66 67 bool show_mixed; // Show mixed source/assembly 68 bool show_bytes; 69 uint32_t num_lines_context; 70 uint32_t num_instructions; 71 bool raw; 72 std::string func_name; 73 bool current_function; 74 lldb::addr_t start_addr; 75 lldb::addr_t end_addr; 76 bool at_pc; 77 bool frame_line; 78 std::string plugin_name; 79 std::string flavor_string; 80 ArchSpec arch; 81 bool some_location_specified; // If no location was specified, we'll select "at_pc". This should be set 82 // in SetOptionValue if anything the selects a location is set. 83 static OptionDefinition g_option_table[]; 84 }; 85 86 CommandObjectDisassemble (CommandInterpreter &interpreter); 87 88 virtual 89 ~CommandObjectDisassemble (); 90 91 virtual 92 Options * 93 GetOptions () 94 { 95 return &m_options; 96 } 97 98 protected: 99 virtual bool 100 DoExecute (Args& command, 101 CommandReturnObject &result); 102 103 CommandOptions m_options; 104 105 }; 106 107 } // namespace lldb_private 108 109 #endif // liblldb_CommandObjectDisassemble_h_ 110