1 //===-- SBModuleSpec.h ------------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SBModuleSpec_h_
10 #define LLDB_SBModuleSpec_h_
12 #include "lldb/API/SBDefines.h"
13 #include "lldb/API/SBFileSpec.h"
17 class LLDB_API SBModuleSpec {
21 SBModuleSpec(const SBModuleSpec &rhs);
25 const SBModuleSpec &operator=(const SBModuleSpec &rhs);
27 explicit operator bool() const;
33 /// Get const accessor for the module file.
35 /// This function returns the file for the module on the host system
36 /// that is running LLDB. This can differ from the path on the
37 /// platform since we might be doing remote debugging.
40 /// A const reference to the file specification object.
41 lldb::SBFileSpec GetFileSpec();
43 void SetFileSpec(const lldb::SBFileSpec &fspec);
45 /// Get accessor for the module platform file.
47 /// Platform file refers to the path of the module as it is known on
48 /// the remote system on which it is being debugged. For local
49 /// debugging this is always the same as Module::GetFileSpec(). But
50 /// remote debugging might mention a file '/usr/lib/liba.dylib'
51 /// which might be locally downloaded and cached. In this case the
52 /// platform file could be something like:
53 /// '/tmp/lldb/platform-cache/remote.host.computer/usr/lib/liba.dylib'
54 /// The file could also be cached in a local developer kit directory.
57 /// A const reference to the file specification object.
58 lldb::SBFileSpec GetPlatformFileSpec();
60 void SetPlatformFileSpec(const lldb::SBFileSpec &fspec);
62 lldb::SBFileSpec GetSymbolFileSpec();
64 void SetSymbolFileSpec(const lldb::SBFileSpec &fspec);
66 const char *GetObjectName();
68 void SetObjectName(const char *name);
70 const char *GetTriple();
72 void SetTriple(const char *triple);
74 const uint8_t *GetUUIDBytes();
76 size_t GetUUIDLength();
78 bool SetUUIDBytes(const uint8_t *uuid, size_t uuid_len);
80 bool GetDescription(lldb::SBStream &description);
83 friend class SBModuleSpecList;
84 friend class SBModule;
85 friend class SBTarget;
87 std::unique_ptr<lldb_private::ModuleSpec> m_opaque_up;
90 class SBModuleSpecList {
94 SBModuleSpecList(const SBModuleSpecList &rhs);
98 SBModuleSpecList &operator=(const SBModuleSpecList &rhs);
100 static SBModuleSpecList GetModuleSpecifications(const char *path);
102 void Append(const SBModuleSpec &spec);
104 void Append(const SBModuleSpecList &spec_list);
106 SBModuleSpec FindFirstMatchingSpec(const SBModuleSpec &match_spec);
108 SBModuleSpecList FindMatchingSpecs(const SBModuleSpec &match_spec);
112 SBModuleSpec GetSpecAtIndex(size_t i);
114 bool GetDescription(lldb::SBStream &description);
117 std::unique_ptr<lldb_private::ModuleSpecList> m_opaque_up;
122 #endif // LLDB_SBModuleSpec_h_