LLDB  mainline
Public Member Functions | Friends | List of all members
lldb::SBModule Class Reference

#include <SBModule.h>

Public Member Functions

 SBModule ()
 
 SBModule (const SBModule &rhs)
 
 SBModule (const SBModuleSpec &module_spec)
 
const SBModuleoperator= (const SBModule &rhs)
 
 SBModule (lldb::SBProcess &process, lldb::addr_t header_addr)
 
 ~SBModule ()
 
 operator bool () const
 
bool IsValid () const
 
void Clear ()
 
lldb::SBFileSpec GetFileSpec () const
 Get const accessor for the module file specification. More...
 
lldb::SBFileSpec GetPlatformFileSpec () const
 Get accessor for the module platform file specification. More...
 
bool SetPlatformFileSpec (const lldb::SBFileSpec &platform_file)
 
lldb::SBFileSpec GetRemoteInstallFileSpec ()
 Get accessor for the remote install path for a module. More...
 
bool SetRemoteInstallFileSpec (lldb::SBFileSpec &file)
 Set accessor for the remote install path for a module. More...
 
lldb::ByteOrder GetByteOrder ()
 
uint32_t GetAddressByteSize ()
 
const char * GetTriple ()
 
const uint8_t * GetUUIDBytes () const
 
const char * GetUUIDString () const
 
bool operator== (const lldb::SBModule &rhs) const
 
bool operator!= (const lldb::SBModule &rhs) const
 
lldb::SBSection FindSection (const char *sect_name)
 
lldb::SBAddress ResolveFileAddress (lldb::addr_t vm_addr)
 
lldb::SBSymbolContext ResolveSymbolContextForAddress (const lldb::SBAddress &addr, uint32_t resolve_scope)
 
bool GetDescription (lldb::SBStream &description)
 
uint32_t GetNumCompileUnits ()
 
lldb::SBCompileUnit GetCompileUnitAtIndex (uint32_t)
 
lldb::SBSymbolContextList FindCompileUnits (const lldb::SBFileSpec &sb_file_spec)
 Find compile units related to *this module and passed source file. More...
 
size_t GetNumSymbols ()
 
lldb::SBSymbol GetSymbolAtIndex (size_t idx)
 
lldb::SBSymbol FindSymbol (const char *name, lldb::SymbolType type=eSymbolTypeAny)
 
lldb::SBSymbolContextList FindSymbols (const char *name, lldb::SymbolType type=eSymbolTypeAny)
 
size_t GetNumSections ()
 
lldb::SBSection GetSectionAtIndex (size_t idx)
 
lldb::SBSymbolContextList FindFunctions (const char *name, uint32_t name_type_mask=lldb::eFunctionNameTypeAny)
 Find functions by name. More...
 
lldb::SBValueList FindGlobalVariables (lldb::SBTarget &target, const char *name, uint32_t max_matches)
 Find global and static variables by name. More...
 
lldb::SBValue FindFirstGlobalVariable (lldb::SBTarget &target, const char *name)
 Find the first global (or static) variable by name. More...
 
lldb::SBType FindFirstType (const char *name)
 
lldb::SBTypeList FindTypes (const char *type)
 
lldb::SBType GetTypeByID (lldb::user_id_t uid)
 Get a type using its type ID. More...
 
lldb::SBType GetBasicType (lldb::BasicType type)
 
lldb::SBTypeList GetTypes (uint32_t type_mask=lldb::eTypeClassAny)
 Get all types matching type_mask from debug info in this module. More...
 
uint32_t GetVersion (uint32_t *versions, uint32_t num_versions)
 Get the module version numbers. More...
 
lldb::SBFileSpec GetSymbolFileSpec () const
 Get accessor for the symbol file specification. More...
 
lldb::SBAddress GetObjectFileHeaderAddress () const
 
lldb::SBAddress GetObjectFileEntryPointAddress () const
 

Friends

class SBAddress
 
class SBFrame
 
class SBSection
 
class SBSymbolContext
 
class SBTarget
 

Detailed Description

Definition at line 20 of file SBModule.h.

Constructor & Destructor Documentation

◆ SBModule() [1/4]

SBModule::SBModule ( )

Definition at line 33 of file SBModule.cpp.

References LLDB_RECORD_CONSTRUCTOR_NO_ARGS.

◆ SBModule() [2/4]

SBModule::SBModule ( const SBModule rhs)

Definition at line 49 of file SBModule.cpp.

References LLDB_RECORD_CONSTRUCTOR.

◆ SBModule() [3/4]

SBModule::SBModule ( const SBModuleSpec module_spec)

Definition at line 39 of file SBModule.cpp.

References LLDB_RECORD_CONSTRUCTOR.

◆ SBModule() [4/4]

SBModule::SBModule ( lldb::SBProcess process,
lldb::addr_t  header_addr 
)

◆ ~SBModule()

SBModule::~SBModule ( )

Definition at line 79 of file SBModule.cpp.

Member Function Documentation

◆ Clear()

void SBModule::Clear ( )

Definition at line 91 of file SBModule.cpp.

References LLDB_RECORD_METHOD_NO_ARGS.

Referenced by lldb_private::repro::RegisterMethods< SBModule >().

◆ FindCompileUnits()

SBSymbolContextList SBModule::FindCompileUnits ( const lldb::SBFileSpec sb_file_spec)

Find compile units related to *this module and passed source file.

Parameters
[in]sb_file_specA lldb::SBFileSpec object that contains source file specification.
Returns
A lldb::SBSymbolContextList that gets filled in with all of the symbol contexts for all the matches.

Definition at line 280 of file SBModule.cpp.

References lldb::SBFileSpec::IsValid(), LLDB_RECORD_METHOD, and LLDB_RECORD_RESULT.

Referenced by lldb_private::repro::RegisterMethods< SBModule >().

◆ FindFirstGlobalVariable()

lldb::SBValue SBModule::FindFirstGlobalVariable ( lldb::SBTarget target,
const char *  name 
)

Find the first global (or static) variable by name.

Parameters
[in]targetA valid SBTarget instance representing the debuggee.
[in]nameThe name of the global or static variable we are looking for.
Returns
An SBValue that gets filled in with the found variable (if any).

Definition at line 447 of file SBModule.cpp.

References FindGlobalVariables(), lldb::SBValueList::GetSize(), lldb::SBValueList::GetValueAtIndex(), lldb::SBValueList::IsValid(), LLDB_RECORD_METHOD, LLDB_RECORD_RESULT, and lldb::SBValue.

Referenced by lldb_private::repro::RegisterMethods< SBModule >().

◆ FindFirstType()

lldb::SBType SBModule::FindFirstType ( const char *  name)

◆ FindFunctions()

lldb::SBSymbolContextList SBModule::FindFunctions ( const char *  name,
uint32_t  name_type_mask = lldb::eFunctionNameTypeAny 
)

Find functions by name.

Parameters
[in]nameThe name of the function we are looking for.
[in]name_type_maskA logical OR of one or more FunctionNameType enum bits that indicate what kind of names should be used when doing the lookup. Bits include fully qualified names, base names, C++ methods, or ObjC selectors. See FunctionNameType for more details.
Returns
A lldb::SBSymbolContextList that gets filled in with all of the symbol contexts for all the matches.

Definition at line 401 of file SBModule.cpp.

References LLDB_RECORD_METHOD, and LLDB_RECORD_RESULT.

Referenced by lldb_private::repro::RegisterMethods< SBModule >().

◆ FindGlobalVariables()

SBValueList SBModule::FindGlobalVariables ( lldb::SBTarget target,
const char *  name,
uint32_t  max_matches 
)

Find global and static variables by name.

Parameters
[in]targetA valid SBTarget instance representing the debuggee.
[in]nameThe name of the global or static variable we are looking for.
[in]max_matchesAllow the number of matches to be limited to max_matches.
Returns
A list of matched variables in an SBValueList.

Definition at line 419 of file SBModule.cpp.

References lldb::SBValueList::Append(), lldb::SBTarget::GetSP(), lldb_private::VariableList::GetVariableAtIndex(), LLDB_RECORD_METHOD, LLDB_RECORD_RESULT, and lldb::SBValue.

Referenced by FindFirstGlobalVariable(), and lldb_private::repro::RegisterMethods< SBModule >().

◆ FindSection()

SBSection SBModule::FindSection ( const char *  sect_name)

◆ FindSymbol()

lldb::SBSymbol SBModule::FindSymbol ( const char *  name,
lldb::SymbolType  type = eSymbolTypeAny 
)

◆ FindSymbols()

lldb::SBSymbolContextList SBModule::FindSymbols ( const char *  name,
lldb::SymbolType  type = eSymbolTypeAny 
)

◆ FindTypes()

lldb::SBTypeList SBModule::FindTypes ( const char *  type)

◆ GetAddressByteSize()

uint32_t SBModule::GetAddressByteSize ( )

◆ GetBasicType()

lldb::SBType SBModule::GetBasicType ( lldb::BasicType  type)

◆ GetByteOrder()

lldb::ByteOrder SBModule::GetByteOrder ( )

◆ GetCompileUnitAtIndex()

SBCompileUnit SBModule::GetCompileUnitAtIndex ( uint32_t  index)

◆ GetDescription()

bool SBModule::GetDescription ( lldb::SBStream description)

◆ GetFileSpec()

SBFileSpec SBModule::GetFileSpec ( ) const

Get const accessor for the module file specification.

This function returns the file for the module on the host system that is running LLDB. This can differ from the path on the platform since we might be doing remote debugging.

Returns
A const reference to the file specification object.

Definition at line 97 of file SBModule.cpp.

References LLDB_RECORD_METHOD_CONST_NO_ARGS, and LLDB_RECORD_RESULT.

Referenced by lldb_private::repro::RegisterMethods< SBModule >().

◆ GetNumCompileUnits()

uint32_t SBModule::GetNumCompileUnits ( )

◆ GetNumSections()

size_t SBModule::GetNumSections ( )

◆ GetNumSymbols()

size_t SBModule::GetNumSymbols ( )

◆ GetObjectFileEntryPointAddress()

lldb::SBAddress SBModule::GetObjectFileEntryPointAddress ( ) const

◆ GetObjectFileHeaderAddress()

lldb::SBAddress SBModule::GetObjectFileHeaderAddress ( ) const

◆ GetPlatformFileSpec()

lldb::SBFileSpec SBModule::GetPlatformFileSpec ( ) const

Get accessor for the module platform file specification.

Platform file refers to the path of the module as it is known on the remote system on which it is being debugged. For local debugging this is always the same as Module::GetFileSpec(). But remote debugging might mention a file '/usr/lib/liba.dylib' which might be locally downloaded and cached. In this case the platform file could be something like: '/tmp/lldb/platform-cache/remote.host.computer/usr/lib/liba.dylib' The file could also be cached in a local developer kit directory.

Returns
A const reference to the file specification object.

Definition at line 108 of file SBModule.cpp.

References LLDB_RECORD_METHOD_CONST_NO_ARGS, and LLDB_RECORD_RESULT.

Referenced by lldb_private::repro::RegisterMethods< SBModule >().

◆ GetRemoteInstallFileSpec()

lldb::SBFileSpec SBModule::GetRemoteInstallFileSpec ( )

Get accessor for the remote install path for a module.

When debugging to a remote platform by connecting to a remote platform, the install path of the module can be set. If the install path is set, every time the process is about to launch the target will install this module on the remote platform prior to launching.

Returns
A file specification object.

Definition at line 136 of file SBModule.cpp.

References LLDB_RECORD_METHOD_NO_ARGS, and LLDB_RECORD_RESULT.

Referenced by lldb_private::repro::RegisterMethods< SBModule >().

◆ GetSectionAtIndex()

SBSection SBModule::GetSectionAtIndex ( size_t  idx)

◆ GetSymbolAtIndex()

SBSymbol SBModule::GetSymbolAtIndex ( size_t  idx)

◆ GetSymbolFileSpec()

lldb::SBFileSpec SBModule::GetSymbolFileSpec ( ) const

Get accessor for the symbol file specification.

When debugging an object file an additional debug information can be provided in separate file. Therefore if you debugging something like '/usr/lib/liba.dylib' then debug information can be located in folder like '/usr/lib/liba.dylib.dSYM/'.

Returns
A const reference to the file specification object.

Definition at line 650 of file SBModule.cpp.

References lldb_private::SymbolVendor::GetMainFileSpec(), LLDB_RECORD_METHOD_CONST_NO_ARGS, and LLDB_RECORD_RESULT.

Referenced by lldb_private::repro::RegisterMethods< SBModule >().

◆ GetTriple()

const char * SBModule::GetTriple ( )

◆ GetTypeByID()

lldb::SBType SBModule::GetTypeByID ( lldb::user_id_t  uid)

Get a type using its type ID.

Each symbol file reader will assign different user IDs to their types, but it is sometimes useful when debugging type issues to be able to grab a type using its type ID.

For DWARF debug info, the type ID is the DIE offset.

Parameters
[in]uidThe type user ID.
Returns
An SBType for the given type ID, or an empty SBType if the type was not found.

Definition at line 530 of file SBModule.cpp.

References LLDB_RECORD_METHOD, LLDB_RECORD_RESULT, lldb_private::SymbolVendor::ResolveTypeUID(), and lldb::SBType.

Referenced by lldb_private::repro::RegisterMethods< SBModule >().

◆ GetTypes()

lldb::SBTypeList SBModule::GetTypes ( uint32_t  type_mask = lldb::eTypeClassAny)

Get all types matching type_mask from debug info in this module.

Parameters
[in]type_maskA bitfield that consists of one or more bits logically OR'ed together from the lldb::TypeClass enumeration. This allows you to request only structure types, or only class, struct and union types. Passing in lldb::eTypeClassAny will return all types found in the debug information for this module.
Returns
A list of types in this module that match type_mask

Definition at line 546 of file SBModule.cpp.

References lldb_private::SymbolVendor::GetTypes(), LLDB_RECORD_METHOD, and LLDB_RECORD_RESULT.

Referenced by lldb_private::repro::RegisterMethods< SBModule >().

◆ GetUUIDBytes()

const uint8_t * SBModule::GetUUIDBytes ( ) const

Definition at line 159 of file SBModule.cpp.

References LLDB_RECORD_METHOD_CONST_NO_ARGS.

◆ GetUUIDString()

const char * SBModule::GetUUIDString ( ) const

◆ GetVersion()

uint32_t SBModule::GetVersion ( uint32_t versions,
uint32_t  num_versions 
)

Get the module version numbers.

Many object files have a set of version numbers that describe the version of the executable or shared library. Typically there are major, minor and build, but there may be more. This function will extract the versions from object files if they are available.

If versions is NULL, or if num_versions is 0, the return value will indicate how many version numbers are available in this object file. Then a subsequent call can be made to this function with a value of versions and num_versions that has enough storage to store some or all version numbers.

Parameters
[out]versionsA pointer to an array of uint32_t types that is num_versions long. If this value is NULL, the return value will indicate how many version numbers are required for a subsequent call to this function so that all versions can be retrieved. If the value is non-NULL, then at most num_versions of the existing versions numbers will be filled into versions. If there is no version information available, versions will be filled with num_versions UINT32_MAX values and zero will be returned.
[in]num_versionsThe maximum number of entries to fill into versions. If this value is zero, then the return value will indicate how many version numbers there are in total so another call to this function can be make with adequate storage in versions to get all of the version numbers. If num_versions is less than the actual number of version numbers in this object file, only num_versions will be filled into versions (if versions is non-NULL).
Returns
This function always returns the number of version numbers that this object file has regardless of the number of version numbers that were copied into versions.

Definition at line 621 of file SBModule.cpp.

References LLDB_RECORD_METHOD, and UINT32_MAX.

Referenced by lldb_private::repro::RegisterMethods< SBModule >().

◆ IsValid()

bool SBModule::IsValid ( ) const

◆ operator bool()

SBModule::operator bool ( ) const
explicit

Definition at line 85 of file SBModule.cpp.

References LLDB_RECORD_METHOD_CONST_NO_ARGS.

◆ operator!=()

bool SBModule::operator!= ( const lldb::SBModule rhs) const

Definition at line 200 of file SBModule.cpp.

References LLDB_RECORD_METHOD_CONST.

◆ operator=()

const SBModule & SBModule::operator= ( const SBModule rhs)

Definition at line 70 of file SBModule.cpp.

References LLDB_RECORD_METHOD, and LLDB_RECORD_RESULT.

◆ operator==()

bool SBModule::operator== ( const lldb::SBModule rhs) const

Definition at line 191 of file SBModule.cpp.

References LLDB_RECORD_METHOD_CONST.

◆ ResolveFileAddress()

SBAddress SBModule::ResolveFileAddress ( lldb::addr_t  vm_addr)

◆ ResolveSymbolContextForAddress()

SBSymbolContext SBModule::ResolveSymbolContextForAddress ( const lldb::SBAddress addr,
uint32_t  resolve_scope 
)

◆ SetPlatformFileSpec()

bool SBModule::SetPlatformFileSpec ( const lldb::SBFileSpec platform_file)

Definition at line 121 of file SBModule.cpp.

References LLDB_RECORD_METHOD.

Referenced by lldb_private::repro::RegisterMethods< SBModule >().

◆ SetRemoteInstallFileSpec()

bool SBModule::SetRemoteInstallFileSpec ( lldb::SBFileSpec file)

Set accessor for the remote install path for a module.

When debugging to a remote platform by connecting to a remote platform, the install path of the module can be set. If the install path is set, every time the process is about to launch the target will install this module on the remote platform prior to launching.

If file specifies a full path to an install location, the module will be installed to this path. If the path is relative (no directory specified, or the path is partial like "usr/lib" or "./usr/lib", then the install path will be resolved using the platform's current working directory as the base path.

Parameters
[in]fileA file specification object.

Definition at line 147 of file SBModule.cpp.

References LLDB_RECORD_METHOD.

Referenced by lldb_private::repro::RegisterMethods< SBModule >().

Friends And Related Function Documentation

◆ SBAddress

friend class SBAddress
friend

Definition at line 292 of file SBModule.h.

◆ SBFrame

friend class SBFrame
friend

Definition at line 293 of file SBModule.h.

◆ SBSection

friend class SBSection
friend

Definition at line 294 of file SBModule.h.

◆ SBSymbolContext

friend class SBSymbolContext
friend

Definition at line 295 of file SBModule.h.

◆ SBTarget

friend class SBTarget
friend

Definition at line 296 of file SBModule.h.


The documentation for this class was generated from the following files: