summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectPlatform.h
blob: 00199158666d24697d47812d77e4343b742ed985 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//===-- CommandObjectPlatform.h ---------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef liblldb_CommandObjectPlatform_h_
#define liblldb_CommandObjectPlatform_h_

// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/Interpreter/CommandObjectMultiword.h"
#include "lldb/Interpreter/Options.h"

namespace lldb_private {

//-------------------------------------------------------------------------
// CommandObjectPlatform
//-------------------------------------------------------------------------

class CommandObjectPlatform : public CommandObjectMultiword
{
public:
    CommandObjectPlatform(CommandInterpreter &interpreter);

    virtual
    ~CommandObjectPlatform();

    private:
    DISALLOW_COPY_AND_ASSIGN (CommandObjectPlatform);
};

    
//-------------------------------------------------------------------------
// PlatformOptionGroup
//
// Make platform options available to to any other command in case they 
// need them. The "file" command needs them, and by exposing them we can
// reuse the platform command options for any command, we can keep things
// consistent.
//-------------------------------------------------------------------------
class PlatformOptionGroup : public OptionGroup
{
public:
    
    PlatformOptionGroup (bool include_platform_option) :
        platform_name (),
        os_version_major (UINT32_MAX),
        os_version_minor (UINT32_MAX),
        os_version_update (UINT32_MAX),
        m_include_platform_option (include_platform_option)
    {
    }
    
    virtual
    ~PlatformOptionGroup ()
    {
    }
    
    virtual uint32_t
    GetNumDefinitions ();
    
    virtual const OptionDefinition*
    GetDefinitions ();
    
    virtual Error
    SetOptionValue (CommandInterpreter &interpreter,
                    uint32_t option_idx,
                    const char *option_value);
    
    lldb::PlatformSP 
    CreatePlatformWithOptions (CommandInterpreter &interpreter, 
                               bool select,
                               Error &error);

    virtual void
    OptionParsingStarting (CommandInterpreter &interpreter);
        
    // Instance variables to hold the values for command options.
    
    std::string platform_name;
    uint32_t os_version_major;
    uint32_t os_version_minor;
    uint32_t os_version_update;
protected:
    bool m_include_platform_option;
};

    
    
} // namespace lldb_private

#endif  // liblldb_CommandObjectPlatform_h_
OpenPOWER on IntegriCloud