libcsdbg  1.28
C++ exception (and generic) stack trace debug library
const i8 * csdbg::symtab::lookup ( mem_addr_t  addr) const
virtual

Lookup an address to resolve a symbol.

Parameters
[in]addrthe address
Returns
the demangled symbol or NULL if the address is unresolved
Note
If demangling failed upon symbol table loading/parsing the decorated symbol is returned

Definition at line 281 of file symtab.cpp.

References csdbg::symbol::addr(), likely, m_table, csdbg::symbol::name(), and unlikely.

Referenced by exists().

282 {
283  for (u32 i = 0, sz = m_table->size(); likely(i < sz); i++) {
284  const symbol *sym = m_table->at(i);
285  if ( unlikely(sym->addr() == addr) )
286  return sym->name();
287  }
288 
289  /* The address was not resolved */
290  return NULL;
291 }
#define likely(expr)
Offer a hint (positive) to the pipeline branch predictor.
Definition: config.hpp:344
unsigned int u32
32-bit unsigned integer
Definition: config.hpp:102
chain< symbol > * m_table
Function symbol table.
Definition: symtab.hpp:37
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.
Definition: config.hpp:349

+ Here is the call graph for this function:

+ Here is the caller graph for this function: