libcsdbg  1.28
C++ exception (and generic) stack trace debug library
const i8 * csdbg::process::ilookup ( mem_addr_t  addr,
mem_addr_t base 
) const
virtual

Inverse lookup. Find the module (executable or DSO library) that defines a symbol and return its path and load base address.

Parameters
[in]addrthe symbol address
[out]basethe load base address of the module
Returns
the path of the module or NULL if the address is unresolved
See Also
tracer::addr2line

Definition at line 300 of file process.cpp.

References csdbg::symtab::base(), csdbg::symtab::exists(), likely, m_modules, csdbg::symtab::path(), and unlikely.

Referenced by csdbg::__cyg_profile_func_enter(), csdbg::__cyg_profile_func_exit(), and csdbg::tracer::trace().

301 {
302  for (u32 i = 0, sz = m_modules->size(); likely(i < sz); i++) {
303  const symtab *tbl = m_modules->at(i);
304 
305  if ( unlikely(tbl->exists(addr)) ) {
306  base = tbl->base();
307  return tbl->path();
308  }
309  }
310 
311  base = 0;
312  return NULL;
313 }
chain< symtab > * m_modules
Symbol table list.
Definition: process.hpp:39
#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
#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: