Greg Clayton | b1888f2 | 2011-03-19 01:12:21 +0000 | [diff] [blame] | 1 | //===-- CommandObjectPlatform.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_CommandObjectPlatform_h_ |
| 11 | #define liblldb_CommandObjectPlatform_h_ |
| 12 | |
| 13 | // C Includes |
| 14 | // C++ Includes |
| 15 | // Other libraries and framework includes |
| 16 | // Project includes |
| 17 | #include "lldb/Interpreter/CommandObjectMultiword.h" |
Greg Clayton | 143fcc3 | 2011-04-13 00:18:08 +0000 | [diff] [blame^] | 18 | #include "lldb/Interpreter/Options.h" |
Greg Clayton | b1888f2 | 2011-03-19 01:12:21 +0000 | [diff] [blame] | 19 | |
| 20 | namespace lldb_private { |
| 21 | |
| 22 | //------------------------------------------------------------------------- |
| 23 | // CommandObjectPlatform |
| 24 | //------------------------------------------------------------------------- |
| 25 | |
| 26 | class CommandObjectPlatform : public CommandObjectMultiword |
| 27 | { |
| 28 | public: |
Greg Clayton | b1888f2 | 2011-03-19 01:12:21 +0000 | [diff] [blame] | 29 | CommandObjectPlatform(CommandInterpreter &interpreter); |
| 30 | |
| 31 | virtual |
| 32 | ~CommandObjectPlatform(); |
| 33 | |
Greg Clayton | 143fcc3 | 2011-04-13 00:18:08 +0000 | [diff] [blame^] | 34 | private: |
Greg Clayton | b1888f2 | 2011-03-19 01:12:21 +0000 | [diff] [blame] | 35 | DISALLOW_COPY_AND_ASSIGN (CommandObjectPlatform); |
| 36 | }; |
| 37 | |
Greg Clayton | 143fcc3 | 2011-04-13 00:18:08 +0000 | [diff] [blame^] | 38 | |
| 39 | //------------------------------------------------------------------------- |
| 40 | // PlatformOptionGroup |
| 41 | // |
| 42 | // Make platform options available to to any other command in case they |
| 43 | // need them. The "file" command needs them, and by exposing them we can |
| 44 | // reuse the platform command options for any command, we can keep things |
| 45 | // consistent. |
| 46 | //------------------------------------------------------------------------- |
| 47 | class PlatformOptionGroup : public OptionGroup |
| 48 | { |
| 49 | public: |
| 50 | |
| 51 | PlatformOptionGroup (bool include_platform_option) : |
| 52 | m_include_platform_option (include_platform_option), |
| 53 | platform_sp (), |
| 54 | os_version_major (UINT32_MAX), |
| 55 | os_version_minor (UINT32_MAX), |
| 56 | os_version_update (UINT32_MAX) |
| 57 | { |
| 58 | } |
| 59 | |
| 60 | virtual |
| 61 | ~PlatformOptionGroup () |
| 62 | { |
| 63 | } |
| 64 | |
| 65 | virtual uint32_t |
| 66 | GetNumDefinitions (); |
| 67 | |
| 68 | virtual const OptionDefinition* |
| 69 | GetDefinitions (); |
| 70 | |
| 71 | virtual Error |
| 72 | SetOptionValue (CommandInterpreter &interpreter, |
| 73 | uint32_t option_idx, |
| 74 | const char *option_value); |
| 75 | |
| 76 | lldb::PlatformSP |
| 77 | CreatePlatformWithOptions (CommandInterpreter &interpreter, |
| 78 | const char *platform_name, |
| 79 | bool select, |
| 80 | Error& error); |
| 81 | |
| 82 | virtual void |
| 83 | OptionParsingStarting (CommandInterpreter &interpreter); |
| 84 | |
| 85 | // Instance variables to hold the values for command options. |
| 86 | |
| 87 | lldb::PlatformSP platform_sp; |
| 88 | uint32_t os_version_major; |
| 89 | uint32_t os_version_minor; |
| 90 | uint32_t os_version_update; |
| 91 | protected: |
| 92 | bool m_include_platform_option; |
| 93 | }; |
| 94 | |
| 95 | |
| 96 | |
Greg Clayton | b1888f2 | 2011-03-19 01:12:21 +0000 | [diff] [blame] | 97 | } // namespace lldb_private |
| 98 | |
| 99 | #endif // liblldb_CommandObjectPlatform_h_ |