9#ifndef LLDB_CORE_ADDRESS_H
10#define LLDB_CORE_ADDRESS_H
18#include "llvm/ADT/StringRef.h"
26class ExecutionContextScope;
259 uint32_t addr_byte_size =
UINT32_MAX,
bool all_ranges =
false,
260 std::optional<Stream::HighlightSettings> settings = std::nullopt)
const;
303 bool is_indirect =
false)
const;
417 bool allow_section_end =
false);
422 bool allow_section_end =
false);
488 lldb::SymbolContextItem resolve_scope =
489 lldb::eSymbolContextEverything)
const;
A section + offset based address range class.
ModulePointerAndOffsetLessThanFunctionObject()=default
bool operator()(const Address &a, const Address &b) const
A section + offset based address class.
static int CompareFileAddress(const Address &lhs, const Address &rhs)
Compare two Address objects.
void SetSection(const lldb::SectionSP §ion_sp)
Set accessor for the section.
lldb::addr_t GetLoadAddress(Target *target) const
Get the load address.
lldb::SectionWP m_section_wp
The section for the address, can be NULL.
bool ResolveAddressUsingFileSections(lldb::addr_t addr, const SectionList *sections)
Resolve a file virtual address using a section list.
lldb::addr_t GetCallableLoadAddress(Target *target, bool is_indirect=false) const
Get the load address as a callable code load address.
bool SetLoadAddress(lldb::addr_t load_addr, Target *target, bool allow_section_end=false)
Set the address to represent load_addr.
lldb::SectionSP GetSection() const
Get const accessor for the section.
bool SectionWasDeleted() const
static int CompareLoadAddress(const Address &lhs, const Address &rhs, Target *target)
uint32_t CalculateSymbolContext(SymbolContext *sc, lldb::SymbolContextItem resolve_scope=lldb::eSymbolContextEverything) const
Reconstruct a symbol context from an address.
const Address & operator=(const Address &rhs)
Assignment operator.
void Clear()
Clear the object's state.
lldb::addr_t GetOpcodeLoadAddress(Target *target, AddressClass addr_class=AddressClass::eInvalid) const
Get the load address as an opcode load address.
lldb::addr_t m_offset
Offset into section if m_section_wp is valid...
bool SetOpcodeLoadAddress(lldb::addr_t load_addr, Target *target, AddressClass addr_class=AddressClass::eInvalid, bool allow_section_end=false)
Address(const Address &rhs)
Copy constructor.
Address(const lldb::SectionSP §ion_sp, lldb::addr_t offset)
Construct with a section pointer and offset.
bool ResolveFunctionScope(lldb_private::SymbolContext &sym_ctx, lldb_private::AddressRange *addr_range_ptr=nullptr)
Resolve this address to its containing function and optionally get that function's address range.
Function * CalculateSymbolContextFunction() const
static int CompareModulePointerAndOffset(const Address &lhs, const Address &rhs)
bool SectionWasDeletedPrivate() const
size_t MemorySize() const
Get the memory cost of this object.
void SetRawAddress(lldb::addr_t addr)
DumpStyle
Dump styles allow the Address::Dump(Stream *,DumpStyle) const function to display Address contents in...
@ DumpStyleFileAddress
Display as the file address (if any).
@ DumpStyleSectionNameOffset
Display as the section name + offset.
@ DumpStyleNoFunctionName
Elide the function name; display an offset into the current function.
@ DumpStyleResolvedDescriptionNoFunctionArguments
@ DumpStyleDetailedSymbolContext
Detailed symbol context information for an address for all symbol context members.
@ DumpStyleInvalid
Invalid dump style.
@ DumpStyleModuleWithFileAddress
Display as the file address with the module name prepended (if any).
@ DumpStyleSectionPointerOffset
Display as the section pointer + offset (debug output).
@ DumpStyleResolvedDescription
Display the details about what an address resolves to.
@ DumpStyleLoadAddress
Display as the load address (if resolved).
@ DumpStyleResolvedDescriptionNoModule
@ DumpStyleResolvedPointerDescription
Dereference a pointer at the current address and then lookup the dereferenced address using DumpStyle...
bool Slide(int64_t offset)
bool Dump(Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, DumpStyle fallback_style=DumpStyleInvalid, uint32_t addr_byte_size=UINT32_MAX, bool all_ranges=false, std::optional< Stream::HighlightSettings > settings=std::nullopt) const
Dump a description of this object to a Stream.
lldb::ModuleSP GetModule() const
Get accessor for the module for this address.
lldb::addr_t GetFileAddress() const
Get the file address.
lldb::addr_t GetOffset() const
Get the section relative offset value.
bool GetDescription(Stream &s, Target &target, lldb::DescriptionLevel level) const
Write a description of this object to a Stream.
bool IsValid() const
Check if the object state is valid.
bool IsSectionOffset() const
Check if an address is section offset.
bool CalculateSymbolContextLineEntry(LineEntry &line_entry) const
CompileUnit * CalculateSymbolContextCompileUnit() const
bool SetOffset(lldb::addr_t offset)
Set accessor for the offset.
Address()=default
Default constructor.
Block * CalculateSymbolContextBlock() const
bool SetCallableLoadAddress(lldb::addr_t load_addr, Target *target)
AddressClass GetAddressClass() const
Symbol * CalculateSymbolContextSymbol() const
lldb::ModuleSP CalculateSymbolContextModule() const
A class that describes a single lexical block.
A class that describes a compilation unit.
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
A class that describes a function.
A stream class that can stream formatted output to a file.
Defines a symbol context baton that can be handed other debug core functions.
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
bool operator!=(const Address &lhs, const Address &rhs)
bool operator>(const Address &lhs, const Address &rhs)
bool operator==(const Address &lhs, const Address &rhs)
bool operator<(const Address &lhs, const Address &rhs)
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
std::shared_ptr< lldb_private::Section > SectionSP
std::shared_ptr< lldb_private::Module > ModuleSP
std::weak_ptr< lldb_private::Section > SectionWP
A line table entry class.