Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //===-- SBAddress.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_SBADDRESS_H
0010 #define LLDB_API_SBADDRESS_H
0011 
0012 #include "lldb/API/SBDefines.h"
0013 #include "lldb/API/SBModule.h"
0014 
0015 namespace lldb {
0016 
0017 class LLDB_API SBAddress {
0018 public:
0019   SBAddress();
0020 
0021   SBAddress(const lldb::SBAddress &rhs);
0022 
0023   SBAddress(lldb::SBSection section, lldb::addr_t offset);
0024 
0025   // Create an address by resolving a load address using the supplied target
0026   SBAddress(lldb::addr_t load_addr, lldb::SBTarget &target);
0027 
0028   ~SBAddress();
0029 
0030   const lldb::SBAddress &operator=(const lldb::SBAddress &rhs);
0031 
0032   explicit operator bool() const;
0033 
0034   // operator== is a free function
0035 
0036   bool operator!=(const SBAddress &rhs) const;
0037 
0038   bool IsValid() const;
0039 
0040   void Clear();
0041 
0042   addr_t GetFileAddress() const;
0043 
0044   addr_t GetLoadAddress(const lldb::SBTarget &target) const;
0045 
0046   void SetAddress(lldb::SBSection section, lldb::addr_t offset);
0047 
0048   void SetLoadAddress(lldb::addr_t load_addr, lldb::SBTarget &target);
0049   bool OffsetAddress(addr_t offset);
0050 
0051   bool GetDescription(lldb::SBStream &description);
0052 
0053   // The following queries can lookup symbol information for a given address.
0054   // An address might refer to code or data from an existing module, or it
0055   // might refer to something on the stack or heap. The following functions
0056   // will only return valid values if the address has been resolved to a code
0057   // or data address using "void SBAddress::SetLoadAddress(...)" or
0058   // "lldb::SBAddress SBTarget::ResolveLoadAddress (...)".
0059   lldb::SBSymbolContext GetSymbolContext(uint32_t resolve_scope);
0060 
0061   // The following functions grab individual objects for a given address and
0062   // are less efficient if you want more than one symbol related objects. Use
0063   // one of the following when you want multiple debug symbol related objects
0064   // for an address:
0065   //    lldb::SBSymbolContext SBAddress::GetSymbolContext (uint32_t
0066   //    resolve_scope);
0067   //    lldb::SBSymbolContext SBTarget::ResolveSymbolContextForAddress (const
0068   //    SBAddress &addr, uint32_t resolve_scope);
0069   // One or more bits from the SymbolContextItem enumerations can be logically
0070   // OR'ed together to more efficiently retrieve multiple symbol objects.
0071 
0072   lldb::SBSection GetSection();
0073 
0074   lldb::addr_t GetOffset();
0075 
0076   lldb::SBModule GetModule();
0077 
0078   lldb::SBCompileUnit GetCompileUnit();
0079 
0080   lldb::SBFunction GetFunction();
0081 
0082   lldb::SBBlock GetBlock();
0083 
0084   lldb::SBSymbol GetSymbol();
0085 
0086   lldb::SBLineEntry GetLineEntry();
0087 
0088 protected:
0089   friend class SBAddressRange;
0090   friend class SBBlock;
0091   friend class SBBreakpoint;
0092   friend class SBBreakpointLocation;
0093   friend class SBFrame;
0094   friend class SBFunction;
0095   friend class SBLineEntry;
0096   friend class SBInstruction;
0097   friend class SBModule;
0098   friend class SBSection;
0099   friend class SBSymbol;
0100   friend class SBSymbolContext;
0101   friend class SBTarget;
0102   friend class SBThread;
0103   friend class SBThreadPlan;
0104   friend class SBValue;
0105   friend class SBQueueItem;
0106 
0107   lldb_private::Address *operator->();
0108 
0109   const lldb_private::Address *operator->() const;
0110 
0111 #ifndef SWIG
0112   friend bool LLDB_API operator==(const SBAddress &lhs, const SBAddress &rhs);
0113 #endif
0114 
0115   lldb_private::Address *get();
0116 
0117   lldb_private::Address &ref();
0118 
0119   const lldb_private::Address &ref() const;
0120 
0121   SBAddress(const lldb_private::Address &address);
0122 
0123   void SetAddress(const lldb_private::Address &address);
0124 
0125 private:
0126   std::unique_ptr<lldb_private::Address> m_opaque_up;
0127 };
0128 
0129 #ifndef SWIG
0130 bool LLDB_API operator==(const SBAddress &lhs, const SBAddress &rhs);
0131 #endif
0132 
0133 } // namespace lldb
0134 
0135 #endif // LLDB_API_SBADDRESS_H