Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:42

0001 //===-- SBModuleSpec.h ------------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_API_SBMODULESPEC_H
0010 #define LLDB_API_SBMODULESPEC_H
0011 
0012 #include "lldb/API/SBDefines.h"
0013 #include "lldb/API/SBFileSpec.h"
0014 
0015 namespace lldb {
0016 
0017 class LLDB_API SBModuleSpec {
0018 public:
0019   SBModuleSpec();
0020 
0021   SBModuleSpec(const SBModuleSpec &rhs);
0022 
0023   ~SBModuleSpec();
0024 
0025   const SBModuleSpec &operator=(const SBModuleSpec &rhs);
0026 
0027   explicit operator bool() const;
0028 
0029   bool IsValid() const;
0030 
0031   void Clear();
0032 
0033   /// Get const accessor for the module file.
0034   ///
0035   /// This function returns the file for the module on the host system
0036   /// that is running LLDB. This can differ from the path on the
0037   /// platform since we might be doing remote debugging.
0038   ///
0039   /// \return
0040   ///     A const reference to the file specification object.
0041   lldb::SBFileSpec GetFileSpec();
0042 
0043   void SetFileSpec(const lldb::SBFileSpec &fspec);
0044 
0045   /// Get accessor for the module platform file.
0046   ///
0047   /// Platform file refers to the path of the module as it is known on
0048   /// the remote system on which it is being debugged. For local
0049   /// debugging this is always the same as Module::GetFileSpec(). But
0050   /// remote debugging might mention a file '/usr/lib/liba.dylib'
0051   /// which might be locally downloaded and cached. In this case the
0052   /// platform file could be something like:
0053   /// '/tmp/lldb/platform-cache/remote.host.computer/usr/lib/liba.dylib'
0054   /// The file could also be cached in a local developer kit directory.
0055   ///
0056   /// \return
0057   ///     A const reference to the file specification object.
0058   lldb::SBFileSpec GetPlatformFileSpec();
0059 
0060   void SetPlatformFileSpec(const lldb::SBFileSpec &fspec);
0061 
0062   lldb::SBFileSpec GetSymbolFileSpec();
0063 
0064   void SetSymbolFileSpec(const lldb::SBFileSpec &fspec);
0065 
0066   const char *GetObjectName();
0067 
0068   void SetObjectName(const char *name);
0069 
0070   const char *GetTriple();
0071 
0072   void SetTriple(const char *triple);
0073 
0074   const uint8_t *GetUUIDBytes();
0075 
0076   size_t GetUUIDLength();
0077 
0078   bool SetUUIDBytes(const uint8_t *uuid, size_t uuid_len);
0079 
0080   uint64_t GetObjectOffset();
0081 
0082   void SetObjectOffset(uint64_t object_offset);
0083 
0084   uint64_t GetObjectSize();
0085 
0086   void SetObjectSize(uint64_t object_size);
0087 
0088   bool GetDescription(lldb::SBStream &description);
0089 
0090 private:
0091   friend class SBModuleSpecList;
0092   friend class SBModule;
0093   friend class SBPlatform;
0094   friend class SBTarget;
0095 
0096   SBModuleSpec(const lldb_private::ModuleSpec &module_spec);
0097 
0098   std::unique_ptr<lldb_private::ModuleSpec> m_opaque_up;
0099 };
0100 
0101 class SBModuleSpecList {
0102 public:
0103   SBModuleSpecList();
0104 
0105   SBModuleSpecList(const SBModuleSpecList &rhs);
0106 
0107   ~SBModuleSpecList();
0108 
0109   SBModuleSpecList &operator=(const SBModuleSpecList &rhs);
0110 
0111   static SBModuleSpecList GetModuleSpecifications(const char *path);
0112 
0113   void Append(const SBModuleSpec &spec);
0114 
0115   void Append(const SBModuleSpecList &spec_list);
0116 
0117   SBModuleSpec FindFirstMatchingSpec(const SBModuleSpec &match_spec);
0118 
0119   SBModuleSpecList FindMatchingSpecs(const SBModuleSpec &match_spec);
0120 
0121   size_t GetSize();
0122 
0123   SBModuleSpec GetSpecAtIndex(size_t i);
0124 
0125   bool GetDescription(lldb::SBStream &description);
0126 
0127 private:
0128   std::unique_ptr<lldb_private::ModuleSpecList> m_opaque_up;
0129 };
0130 
0131 } // namespace lldb
0132 
0133 #endif // LLDB_API_SBMODULESPEC_H