Chris Lattner | 30fdc8d | 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 | |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 13 | #include "lldb/Interpreter/CommandObject.h" |
Jim Ingham | 40af72e | 2010-06-15 19:49:27 +0000 | [diff] [blame] | 14 | #include "lldb/Interpreter/Options.h" |
Pavel Labath | 5f19b90 | 2017-11-13 16:16:33 +0000 | [diff] [blame^] | 15 | #include "lldb/Utility/ArchSpec.h" |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 16 | |
| 17 | namespace lldb_private { |
| 18 | |
| 19 | //------------------------------------------------------------------------- |
| 20 | // CommandObjectDisassemble |
| 21 | //------------------------------------------------------------------------- |
| 22 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 23 | class CommandObjectDisassemble : public CommandObjectParsed { |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 24 | public: |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 25 | class CommandOptions : public Options { |
| 26 | public: |
| 27 | CommandOptions(); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 28 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 29 | ~CommandOptions() override; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 30 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 31 | Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, |
| 32 | ExecutionContext *execution_context) override; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 33 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 34 | void OptionParsingStarting(ExecutionContext *execution_context) override; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 35 | |
Zachary Turner | 1f0f5b5 | 2016-09-22 20:22:55 +0000 | [diff] [blame] | 36 | llvm::ArrayRef<OptionDefinition> GetDefinitions() override; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 37 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 38 | const char *GetPluginName() { |
| 39 | return (plugin_name.empty() ? nullptr : plugin_name.c_str()); |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 40 | } |
| 41 | |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 42 | const char *GetFlavorString() { |
| 43 | if (flavor_string.empty() || flavor_string == "default") |
| 44 | return nullptr; |
| 45 | return flavor_string.c_str(); |
| 46 | } |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 47 | |
Zachary Turner | 97206d5 | 2017-05-12 04:51:55 +0000 | [diff] [blame] | 48 | Status OptionParsingFinished(ExecutionContext *execution_context) override; |
Kate Stone | b9c1b51 | 2016-09-06 20:57:50 +0000 | [diff] [blame] | 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 | static OptionDefinition g_option_table[]; |
| 69 | }; |
| 70 | |
| 71 | CommandObjectDisassemble(CommandInterpreter &interpreter); |
| 72 | |
| 73 | ~CommandObjectDisassemble() override; |
| 74 | |
| 75 | Options *GetOptions() override { return &m_options; } |
| 76 | |
| 77 | protected: |
| 78 | bool DoExecute(Args &command, CommandReturnObject &result) override; |
| 79 | |
| 80 | CommandOptions m_options; |
Chris Lattner | 30fdc8d | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 81 | }; |
| 82 | |
| 83 | } // namespace lldb_private |
| 84 | |
Pavel Labath | 1fb7e20 | 2015-09-02 09:33:09 +0000 | [diff] [blame] | 85 | #endif // liblldb_CommandObjectDisassemble_h_ |