libcsdbg  1.28
C++ exception (and generic) stack trace debug library
process & csdbg::process::cache_add ( mem_addr_t  addr,
const i8 nm 
)
protectedvirtual

Add a symbol to the lookup cache.

Parameters
[in]addrthe symbol address
[in]nmthe symbol name (NULL if the address is unresolved)
Returns
*this

Definition at line 21 of file process.cpp.

References csdbg::util::dbg_error(), csdbg::util::lock(), m_symcache, and csdbg::util::unlock().

Referenced by lookup().

22 {
23  util::lock();
24  symbol *sym = NULL;
25  try {
26  sym = new symbol(addr, nm);
27  m_symcache->add(sym);
28  }
29 
30  catch (std::exception &x) {
31  delete sym;
32  util::dbg_error("in process::%s(): %s", __FUNCTION__, x.what());
33  }
34 
35  util::unlock();
36  return *this;
37 }
static void lock()
Lock the global access mutex.
Definition: util.cpp:397
static void unlock()
Unlock the global access mutex.
Definition: util.cpp:406
static void dbg_error(const i8 *,...)
Print an error debug message on the standard error stream.
Definition: util.cpp:726
chain< symbol > * m_symcache
Lookup cache.
Definition: process.hpp:41

+ Here is the call graph for this function:

+ Here is the caller graph for this function: