1//===-- SBModuleSpec.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 LLDB_SBModuleSpec_h_
11#define LLDB_SBModuleSpec_h_
12
13#include "lldb/API/SBDefines.h"
14#include "lldb/API/SBFileSpec.h"
15
16namespace lldb {
17
18class SBModuleSpec
19{
20public:
21
22    SBModuleSpec ();
23
24    SBModuleSpec (const SBModuleSpec &rhs);
25
26    ~SBModuleSpec ();
27
28    const SBModuleSpec &
29    operator = (const SBModuleSpec &rhs);
30
31    bool
32    IsValid () const;
33
34    void
35    Clear();
36
37    //------------------------------------------------------------------
38    /// Get const accessor for the module file.
39    ///
40    /// This function returns the file for the module on the host system
41    /// that is running LLDB. This can differ from the path on the
42    /// platform since we might be doing remote debugging.
43    ///
44    /// @return
45    ///     A const reference to the file specification object.
46    //------------------------------------------------------------------
47    lldb::SBFileSpec
48    GetFileSpec ();
49
50    void
51    SetFileSpec (const lldb::SBFileSpec &fspec);
52
53    //------------------------------------------------------------------
54    /// Get accessor for the module platform file.
55    ///
56    /// Platform file refers to the path of the module as it is known on
57    /// the remote system on which it is being debugged. For local
58    /// debugging this is always the same as Module::GetFileSpec(). But
59    /// remote debugging might mention a file '/usr/lib/liba.dylib'
60    /// which might be locally downloaded and cached. In this case the
61    /// platform file could be something like:
62    /// '/tmp/lldb/platform-cache/remote.host.computer/usr/lib/liba.dylib'
63    /// The file could also be cached in a local developer kit directory.
64    ///
65    /// @return
66    ///     A const reference to the file specification object.
67    //------------------------------------------------------------------
68    lldb::SBFileSpec
69    GetPlatformFileSpec ();
70
71    void
72    SetPlatformFileSpec (const lldb::SBFileSpec &fspec);
73
74    lldb::SBFileSpec
75    GetSymbolFileSpec ();
76
77    void
78    SetSymbolFileSpec (const lldb::SBFileSpec &fspec);
79
80    const char *
81    GetObjectName ();
82
83    void
84    SetObjectName (const char *name);
85
86    const char *
87    GetTriple ();
88
89    void
90    SetTriple (const char *triple);
91
92    const uint8_t *
93    GetUUIDBytes ();
94
95    size_t
96    GetUUIDLength ();
97
98    bool
99    SetUUIDBytes (const uint8_t *uuid, size_t uuid_len);
100
101    bool
102    GetDescription (lldb::SBStream &description);
103
104private:
105    friend class SBModuleSpecList;
106    friend class SBModule;
107    friend class SBTarget;
108
109    std::unique_ptr<lldb_private::ModuleSpec> m_opaque_ap;
110};
111
112class SBModuleSpecList
113{
114public:
115    SBModuleSpecList();
116
117    SBModuleSpecList (const SBModuleSpecList &rhs);
118
119    ~SBModuleSpecList();
120
121    SBModuleSpecList &
122    operator = (const SBModuleSpecList &rhs);
123
124    static SBModuleSpecList
125    GetModuleSpecifications (const char *path);
126
127    void
128    Append (const SBModuleSpec &spec);
129
130    void
131    Append (const SBModuleSpecList &spec_list);
132
133    SBModuleSpec
134    FindFirstMatchingSpec (const SBModuleSpec &match_spec);
135
136    SBModuleSpecList
137    FindMatchingSpecs (const SBModuleSpec &match_spec);
138
139    size_t
140    GetSize();
141
142    SBModuleSpec
143    GetSpecAtIndex (size_t i);
144
145    bool
146    GetDescription (lldb::SBStream &description);
147
148private:
149    std::unique_ptr<lldb_private::ModuleSpecList> m_opaque_ap;
150};
151
152} // namespace lldb
153
154#endif // LLDB_SBModuleSpec_h_
155