gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::loader::Symbol Class Reference

#include <symtab.hh>

Public Types

enum class  Binding { Global , Local , Weak }
 
enum class  SymbolType {
  NoType , Object , Function , Section ,
  File , Other
}
 

Public Member Functions

 Symbol (const Binding binding, const SymbolType type, const std::string &name, const Addr addr, const size_t size)
 
 Symbol (const Binding binding, const SymbolType type, const std::string &name, const Addr addr)
 
 Symbol (const Symbol &other)=default
 
Symboloperator= (const Symbol &other)=default
 
Binding binding () const
 
SymbolType type () const
 
std::string name () const
 
void rename (const std::string &new_name)
 
Addr address () const
 
void relocate (const Addr new_addr)
 
size_t sizeOrDefault (const size_t default_size) const
 Return the Symbol size if it is valid, otherwise return the default value supplied.
 
bool sizeIsValid () const
 Return whether the Symbol size is valid or not.
 

Private Attributes

Binding _binding
 
SymbolType _type
 
std::string _name
 
Addr _address
 
size_t _size
 
bool _sizeIsValid
 

Detailed Description

Definition at line 62 of file symtab.hh.

Member Enumeration Documentation

◆ Binding

enum class gem5::loader::Symbol::Binding
strong
Enumerator
Global 
Local 
Weak 

Definition at line 65 of file symtab.hh.

◆ SymbolType

Enumerator
NoType 
Object 
Function 
Section 
File 
Other 

Definition at line 73 of file symtab.hh.

Constructor & Destructor Documentation

◆ Symbol() [1/3]

gem5::loader::Symbol::Symbol ( const Binding binding,
const SymbolType type,
const std::string & name,
const Addr addr,
const size_t size )
inline

Definition at line 83 of file symtab.hh.

◆ Symbol() [2/3]

gem5::loader::Symbol::Symbol ( const Binding binding,
const SymbolType type,
const std::string & name,
const Addr addr )
inline

Definition at line 89 of file symtab.hh.

◆ Symbol() [3/3]

gem5::loader::Symbol::Symbol ( const Symbol & other)
default

Member Function Documentation

◆ address()

Addr gem5::loader::Symbol::address ( ) const
inline

◆ binding()

Binding gem5::loader::Symbol::binding ( ) const
inline

Definition at line 98 of file symtab.hh.

References _binding.

Referenced by getSymbolError(), TEST(), TEST(), TEST(), and TEST().

◆ name()

std::string gem5::loader::Symbol::name ( ) const
inline

◆ operator=()

Symbol & gem5::loader::Symbol::operator= ( const Symbol & other)
default

◆ relocate()

void gem5::loader::Symbol::relocate ( const Addr new_addr)
inline

Definition at line 118 of file symtab.hh.

References _address.

Referenced by gem5::PowerProcess::initState().

◆ rename()

void gem5::loader::Symbol::rename ( const std::string & new_name)
inline

Definition at line 110 of file symtab.hh.

References _name.

Referenced by gem5::loader::SymbolTable::rename().

◆ sizeIsValid()

bool gem5::loader::Symbol::sizeIsValid ( ) const
inline

Return whether the Symbol size is valid or not.

Definition at line 137 of file symtab.hh.

References _sizeIsValid.

◆ sizeOrDefault()

size_t gem5::loader::Symbol::sizeOrDefault ( const size_t default_size) const
inline

Return the Symbol size if it is valid, otherwise return the default value supplied.

This method forces the client code to consider the possibility that the SymbolTable may contain Symbols that do not have valid sizes.

Definition at line 130 of file symtab.hh.

References _size, and _sizeIsValid.

◆ type()

SymbolType gem5::loader::Symbol::type ( ) const
inline

Definition at line 102 of file symtab.hh.

References _type.

Referenced by getSymbolError(), TEST(), TEST(), TEST(), and TEST().

Member Data Documentation

◆ _address

Addr gem5::loader::Symbol::_address
private

Definition at line 145 of file symtab.hh.

Referenced by address(), and relocate().

◆ _binding

Binding gem5::loader::Symbol::_binding
private

Definition at line 142 of file symtab.hh.

Referenced by binding().

◆ _name

std::string gem5::loader::Symbol::_name
private

Definition at line 144 of file symtab.hh.

Referenced by name(), and rename().

◆ _size

size_t gem5::loader::Symbol::_size
private

Definition at line 146 of file symtab.hh.

Referenced by sizeOrDefault().

◆ _sizeIsValid

bool gem5::loader::Symbol::_sizeIsValid
private

Definition at line 147 of file symtab.hh.

Referenced by sizeIsValid(), and sizeOrDefault().

◆ _type

SymbolType gem5::loader::Symbol::_type
private

Definition at line 143 of file symtab.hh.

Referenced by type().


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

Generated on Tue Jun 18 2024 16:24:19 for gem5 by doxygen 1.11.0