aboutsummaryrefslogtreecommitdiff
path: root/include/lldb/API/SBModuleSpec.h
blob: d533de3c7bce018b38f4bb9cfb60032216781f12 (plain) (blame)
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
//===-- SBModuleSpec.h ------------------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef LLDB_SBModuleSpec_h_
#define LLDB_SBModuleSpec_h_

#include "lldb/API/SBDefines.h"
#include "lldb/API/SBFileSpec.h"

namespace lldb {

class LLDB_API SBModuleSpec
{
public:

    SBModuleSpec ();

    SBModuleSpec (const SBModuleSpec &rhs);

    ~SBModuleSpec ();

    const SBModuleSpec &
    operator = (const SBModuleSpec &rhs);

    bool
    IsValid () const;

    void
    Clear();

    //------------------------------------------------------------------
    /// Get const accessor for the module file.
    ///
    /// This function returns the file for the module on the host system
    /// that is running LLDB. This can differ from the path on the 
    /// platform since we might be doing remote debugging.
    ///
    /// @return
    ///     A const reference to the file specification object.
    //------------------------------------------------------------------
    lldb::SBFileSpec
    GetFileSpec ();

    void
    SetFileSpec (const lldb::SBFileSpec &fspec);

    //------------------------------------------------------------------
    /// Get accessor for the module platform file.
    ///
    /// Platform file refers to the path of the module as it is known on
    /// the remote system on which it is being debugged. For local 
    /// debugging this is always the same as Module::GetFileSpec(). But
    /// remote debugging might mention a file '/usr/lib/liba.dylib'
    /// which might be locally downloaded and cached. In this case the
    /// platform file could be something like:
    /// '/tmp/lldb/platform-cache/remote.host.computer/usr/lib/liba.dylib'
    /// The file could also be cached in a local developer kit directory.
    ///
    /// @return
    ///     A const reference to the file specification object.
    //------------------------------------------------------------------
    lldb::SBFileSpec
    GetPlatformFileSpec ();

    void
    SetPlatformFileSpec (const lldb::SBFileSpec &fspec);

    lldb::SBFileSpec
    GetSymbolFileSpec ();
    
    void
    SetSymbolFileSpec (const lldb::SBFileSpec &fspec);

    const char *
    GetObjectName ();
    
    void
    SetObjectName (const char *name);

    const char *
    GetTriple ();

    void
    SetTriple (const char *triple);

    const uint8_t *
    GetUUIDBytes ();

    size_t
    GetUUIDLength ();

    bool
    SetUUIDBytes (const uint8_t *uuid, size_t uuid_len);

    bool
    GetDescription (lldb::SBStream &description);
    
private:
    friend class SBModuleSpecList;
    friend class SBModule;
    friend class SBTarget;

    std::unique_ptr<lldb_private::ModuleSpec> m_opaque_ap;
};

class SBModuleSpecList
{
public:
    SBModuleSpecList();

    SBModuleSpecList (const SBModuleSpecList &rhs);

    ~SBModuleSpecList();

    SBModuleSpecList &
    operator = (const SBModuleSpecList &rhs);
    
    static SBModuleSpecList
    GetModuleSpecifications (const char *path);
    
    void
    Append (const SBModuleSpec &spec);
    
    void
    Append (const SBModuleSpecList &spec_list);

    SBModuleSpec
    FindFirstMatchingSpec (const SBModuleSpec &match_spec);

    SBModuleSpecList
    FindMatchingSpecs (const SBModuleSpec &match_spec);

    size_t
    GetSize();
    
    SBModuleSpec
    GetSpecAtIndex (size_t i);

    bool
    GetDescription (lldb::SBStream &description);
    
private:
    std::unique_ptr<lldb_private::ModuleSpecList> m_opaque_ap;
};

} // namespace lldb

#endif // LLDB_SBModuleSpec_h_