LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
LIEF::dwarf::DebugInfo Class Reference

This class represents a DWARF debug information. It can embed different compilation units which can be accessed through compilation_units() . More...

#include <DebugInfo.hpp>

Inheritance diagram for LIEF::dwarf::DebugInfo:
Collaboration diagram for LIEF::dwarf::DebugInfo:

Public Types

using compilation_units_it = iterator_range<CompilationUnit::Iterator>
 Iterator over the CompilationUnit.
 
- Public Types inherited from LIEF::DebugInfo
enum class  FORMAT { UNKNOWN = 0 , DWARF , PDB }
 

Public Member Functions

std::unique_ptr< Functionfind_function (const std::string &name) const
 Try to find the function with the given name (mangled or not)
 
std::unique_ptr< Functionfind_function (uint64_t addr) const
 Try to find the function at the given virtual address.
 
std::unique_ptr< Variablefind_variable (const std::string &name) const
 Try to find the variable with the given name. This name can be mangled or not.
 
std::unique_ptr< Variablefind_variable (uint64_t addr) const
 Try to find the variable at the given virtual address.
 
std::unique_ptr< Typefind_type (const std::string &name) const
 Try to find the type with the given name.
 
compilation_units_it compilation_units () const
 Iterator on the CompilationUnit embedded in this dwarf.
 
FORMAT format () const override
 
 ~DebugInfo () override=default
 
 DebugInfo (std::unique_ptr< details::DebugInfo > impl)
 
- Public Member Functions inherited from LIEF::DebugInfo
 DebugInfo (std::unique_ptr< details::DebugInfo > impl)
 
template<class T >
const T * as () const
 This function can be used to down cast a DebugInfo instance:
 

Static Public Member Functions

static std::unique_ptr< DebugInfofrom_file (const std::string &path)
 
static bool classof (const LIEF::DebugInfo *info)
 

Detailed Description

This class represents a DWARF debug information. It can embed different compilation units which can be accessed through compilation_units() .

This class can be instantiated from LIEF::Binary::debug_info() or load()

Member Typedef Documentation

◆ compilation_units_it

Constructor & Destructor Documentation

◆ ~DebugInfo()

LIEF::dwarf::DebugInfo::~DebugInfo ( )
overridevirtualdefault

Reimplemented from LIEF::DebugInfo.

◆ DebugInfo()

LIEF::DebugInfo::DebugInfo ( std::unique_ptr< details::DebugInfo > impl)

Member Function Documentation

◆ classof()

static bool LIEF::dwarf::DebugInfo::classof ( const LIEF::DebugInfo * info)
inlinestatic

◆ compilation_units()

compilation_units_it LIEF::dwarf::DebugInfo::compilation_units ( ) const

Iterator on the CompilationUnit embedded in this dwarf.

◆ find_function() [1/2]

std::unique_ptr< Function > LIEF::dwarf::DebugInfo::find_function ( const std::string & name) const

Try to find the function with the given name (mangled or not)

const DebugInfo& info = ...;
if (auto func = info.find_function("_ZNSt6localeD1Ev")) {
// Found
}
if (auto func = info.find_function("std::locale::~locale()")) {
// Found
}
DebugInfo(std::unique_ptr< details::DebugInfo > impl)

◆ find_function() [2/2]

std::unique_ptr< Function > LIEF::dwarf::DebugInfo::find_function ( uint64_t addr) const

Try to find the function at the given virtual address.

◆ find_type()

std::unique_ptr< Type > LIEF::dwarf::DebugInfo::find_type ( const std::string & name) const

Try to find the type with the given name.

◆ find_variable() [1/2]

std::unique_ptr< Variable > LIEF::dwarf::DebugInfo::find_variable ( const std::string & name) const

Try to find the variable with the given name. This name can be mangled or not.

◆ find_variable() [2/2]

std::unique_ptr< Variable > LIEF::dwarf::DebugInfo::find_variable ( uint64_t addr) const

Try to find the variable at the given virtual address.

◆ format()

FORMAT LIEF::dwarf::DebugInfo::format ( ) const
inlineoverridevirtual

Reimplemented from LIEF::DebugInfo.

References LIEF::DebugInfo::DWARF.

◆ from_file()

static std::unique_ptr< DebugInfo > LIEF::dwarf::DebugInfo::from_file ( const std::string & path)
static

Referenced by LIEF::dwarf::load().


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