1254721Semaste//===-- SBModuleSpec.h ------------------------------------------*- C++ -*-===//
2254721Semaste//
3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4353358Sdim// See https://llvm.org/LICENSE.txt for license information.
5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6254721Semaste//
7254721Semaste//===----------------------------------------------------------------------===//
8254721Semaste
9254721Semaste#ifndef LLDB_SBModuleSpec_h_
10254721Semaste#define LLDB_SBModuleSpec_h_
11254721Semaste
12254721Semaste#include "lldb/API/SBDefines.h"
13254721Semaste#include "lldb/API/SBFileSpec.h"
14254721Semaste
15254721Semastenamespace lldb {
16254721Semaste
17314564Sdimclass LLDB_API SBModuleSpec {
18254721Semastepublic:
19314564Sdim  SBModuleSpec();
20254721Semaste
21314564Sdim  SBModuleSpec(const SBModuleSpec &rhs);
22254721Semaste
23314564Sdim  ~SBModuleSpec();
24254721Semaste
25314564Sdim  const SBModuleSpec &operator=(const SBModuleSpec &rhs);
26254721Semaste
27353358Sdim  explicit operator bool() const;
28353358Sdim
29314564Sdim  bool IsValid() const;
30254721Semaste
31314564Sdim  void Clear();
32254721Semaste
33314564Sdim  /// Get const accessor for the module file.
34314564Sdim  ///
35314564Sdim  /// This function returns the file for the module on the host system
36314564Sdim  /// that is running LLDB. This can differ from the path on the
37314564Sdim  /// platform since we might be doing remote debugging.
38314564Sdim  ///
39353358Sdim  /// \return
40314564Sdim  ///     A const reference to the file specification object.
41314564Sdim  lldb::SBFileSpec GetFileSpec();
42254721Semaste
43314564Sdim  void SetFileSpec(const lldb::SBFileSpec &fspec);
44254721Semaste
45314564Sdim  /// Get accessor for the module platform file.
46314564Sdim  ///
47314564Sdim  /// Platform file refers to the path of the module as it is known on
48314564Sdim  /// the remote system on which it is being debugged. For local
49314564Sdim  /// debugging this is always the same as Module::GetFileSpec(). But
50314564Sdim  /// remote debugging might mention a file '/usr/lib/liba.dylib'
51314564Sdim  /// which might be locally downloaded and cached. In this case the
52314564Sdim  /// platform file could be something like:
53314564Sdim  /// '/tmp/lldb/platform-cache/remote.host.computer/usr/lib/liba.dylib'
54314564Sdim  /// The file could also be cached in a local developer kit directory.
55314564Sdim  ///
56353358Sdim  /// \return
57314564Sdim  ///     A const reference to the file specification object.
58314564Sdim  lldb::SBFileSpec GetPlatformFileSpec();
59254721Semaste
60314564Sdim  void SetPlatformFileSpec(const lldb::SBFileSpec &fspec);
61254721Semaste
62314564Sdim  lldb::SBFileSpec GetSymbolFileSpec();
63254721Semaste
64314564Sdim  void SetSymbolFileSpec(const lldb::SBFileSpec &fspec);
65254721Semaste
66314564Sdim  const char *GetObjectName();
67254721Semaste
68314564Sdim  void SetObjectName(const char *name);
69254721Semaste
70314564Sdim  const char *GetTriple();
71254721Semaste
72314564Sdim  void SetTriple(const char *triple);
73254721Semaste
74314564Sdim  const uint8_t *GetUUIDBytes();
75254721Semaste
76314564Sdim  size_t GetUUIDLength();
77254721Semaste
78314564Sdim  bool SetUUIDBytes(const uint8_t *uuid, size_t uuid_len);
79314564Sdim
80314564Sdim  bool GetDescription(lldb::SBStream &description);
81314564Sdim
82254721Semasteprivate:
83314564Sdim  friend class SBModuleSpecList;
84314564Sdim  friend class SBModule;
85314564Sdim  friend class SBTarget;
86254721Semaste
87353358Sdim  std::unique_ptr<lldb_private::ModuleSpec> m_opaque_up;
88254721Semaste};
89254721Semaste
90314564Sdimclass SBModuleSpecList {
91254721Semastepublic:
92314564Sdim  SBModuleSpecList();
93254721Semaste
94314564Sdim  SBModuleSpecList(const SBModuleSpecList &rhs);
95254721Semaste
96314564Sdim  ~SBModuleSpecList();
97254721Semaste
98314564Sdim  SBModuleSpecList &operator=(const SBModuleSpecList &rhs);
99254721Semaste
100314564Sdim  static SBModuleSpecList GetModuleSpecifications(const char *path);
101254721Semaste
102314564Sdim  void Append(const SBModuleSpec &spec);
103254721Semaste
104314564Sdim  void Append(const SBModuleSpecList &spec_list);
105254721Semaste
106314564Sdim  SBModuleSpec FindFirstMatchingSpec(const SBModuleSpec &match_spec);
107314564Sdim
108314564Sdim  SBModuleSpecList FindMatchingSpecs(const SBModuleSpec &match_spec);
109314564Sdim
110314564Sdim  size_t GetSize();
111314564Sdim
112314564Sdim  SBModuleSpec GetSpecAtIndex(size_t i);
113314564Sdim
114314564Sdim  bool GetDescription(lldb::SBStream &description);
115314564Sdim
116254721Semasteprivate:
117353358Sdim  std::unique_ptr<lldb_private::ModuleSpecList> m_opaque_up;
118254721Semaste};
119254721Semaste
120254721Semaste} // namespace lldb
121254721Semaste
122254721Semaste#endif // LLDB_SBModuleSpec_h_
123