Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 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/Interpreter/CommandObject.h" |
Jim Ingham | 84cdc15 | 2010-06-15 19:49:27 +0000 | [diff] [blame] | 18 | #include "lldb/Interpreter/Options.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 19 | |
| 20 | namespace lldb_private { |
| 21 | |
| 22 | //------------------------------------------------------------------------- |
| 23 | // CommandObjectDisassemble |
| 24 | //------------------------------------------------------------------------- |
| 25 | |
Jim Ingham | da26bd2 | 2012-06-08 21:56:10 +0000 | [diff] [blame^] | 26 | class CommandObjectDisassemble : public CommandObjectParsed |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 27 | { |
| 28 | public: |
| 29 | class CommandOptions : public Options |
| 30 | { |
| 31 | public: |
| 32 | |
Greg Clayton | f15996e | 2011-04-07 22:46:35 +0000 | [diff] [blame] | 33 | CommandOptions (CommandInterpreter &interpreter); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 34 | |
| 35 | virtual |
| 36 | ~CommandOptions (); |
| 37 | |
| 38 | virtual Error |
Greg Clayton | 143fcc3 | 2011-04-13 00:18:08 +0000 | [diff] [blame] | 39 | SetOptionValue (uint32_t option_idx, const char *option_arg); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 40 | |
| 41 | void |
Greg Clayton | 143fcc3 | 2011-04-13 00:18:08 +0000 | [diff] [blame] | 42 | OptionParsingStarting (); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 43 | |
Greg Clayton | b344843 | 2011-03-24 21:19:54 +0000 | [diff] [blame] | 44 | const OptionDefinition* |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 45 | GetDefinitions (); |
| 46 | |
Greg Clayton | 149731c | 2011-03-25 18:03:16 +0000 | [diff] [blame] | 47 | const char * |
| 48 | GetPluginName () |
| 49 | { |
Greg Clayton | 24bc5d9 | 2011-03-30 18:16:51 +0000 | [diff] [blame] | 50 | if (plugin_name.empty()) |
Greg Clayton | 149731c | 2011-03-25 18:03:16 +0000 | [diff] [blame] | 51 | return NULL; |
Greg Clayton | 24bc5d9 | 2011-03-30 18:16:51 +0000 | [diff] [blame] | 52 | return plugin_name.c_str(); |
Greg Clayton | 149731c | 2011-03-25 18:03:16 +0000 | [diff] [blame] | 53 | } |
| 54 | |
Jim Ingham | d2ad7fd | 2011-09-01 01:11:04 +0000 | [diff] [blame] | 55 | virtual Error |
| 56 | OptionParsingFinished (); |
Greg Clayton | 149731c | 2011-03-25 18:03:16 +0000 | [diff] [blame] | 57 | |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 58 | bool show_mixed; // Show mixed source/assembly |
| 59 | bool show_bytes; |
| 60 | uint32_t num_lines_context; |
Jim Ingham | aa3e3e1 | 2011-03-22 01:48:42 +0000 | [diff] [blame] | 61 | uint32_t num_instructions; |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 62 | bool raw; |
Greg Clayton | 24bc5d9 | 2011-03-30 18:16:51 +0000 | [diff] [blame] | 63 | std::string func_name; |
Jim Ingham | d2ad7fd | 2011-09-01 01:11:04 +0000 | [diff] [blame] | 64 | bool cur_function; |
Greg Clayton | 24bc5d9 | 2011-03-30 18:16:51 +0000 | [diff] [blame] | 65 | lldb::addr_t start_addr; |
| 66 | lldb::addr_t end_addr; |
| 67 | bool at_pc; |
| 68 | bool frame_line; |
| 69 | std::string plugin_name; |
| 70 | ArchSpec arch; |
Jim Ingham | d2ad7fd | 2011-09-01 01:11:04 +0000 | [diff] [blame] | 71 | bool some_location_specified; // If no location was specified, we'll select "at_pc". This should be set |
| 72 | // in SetOptionValue if anything the selects a location is set. |
Greg Clayton | b344843 | 2011-03-24 21:19:54 +0000 | [diff] [blame] | 73 | static OptionDefinition g_option_table[]; |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 74 | }; |
| 75 | |
Greg Clayton | 238c0a1 | 2010-09-18 01:14:36 +0000 | [diff] [blame] | 76 | CommandObjectDisassemble (CommandInterpreter &interpreter); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 77 | |
| 78 | virtual |
| 79 | ~CommandObjectDisassemble (); |
| 80 | |
| 81 | virtual |
| 82 | Options * |
| 83 | GetOptions () |
| 84 | { |
| 85 | return &m_options; |
| 86 | } |
| 87 | |
Jim Ingham | da26bd2 | 2012-06-08 21:56:10 +0000 | [diff] [blame^] | 88 | protected: |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 89 | virtual bool |
Jim Ingham | da26bd2 | 2012-06-08 21:56:10 +0000 | [diff] [blame^] | 90 | DoExecute (Args& command, |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 91 | CommandReturnObject &result); |
| 92 | |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 93 | CommandOptions m_options; |
| 94 | |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 95 | }; |
| 96 | |
| 97 | } // namespace lldb_private |
| 98 | |
| 99 | #endif // liblldb_CommandObjectDisassemble_h_ |