libcsdbg  1.28
C++ exception (and generic) stack trace debug library
symtab & csdbg::symtab::operator= ( const symtab rval)
virtual

Assignment operator.

Parameters
[in]rvalthe assigned object
Returns
*this
Exceptions
std::bad_alloc

Definition at line 239 of file symtab.cpp.

References m_base, m_path, m_table, and unlikely.

240 {
241  if ( unlikely(this == &rval) )
242  return *this;
243 
244  u32 len = strlen(rval.m_path);
245  if (len > strlen(m_path)) {
246  delete[] m_path;
247  m_path = NULL;
248  m_path = new i8[len + 1];
249  }
250 
251  strcpy(m_path, rval.m_path);
252  m_base = rval.m_base;
253  *m_table = *rval.m_table;
254 
255  return *this;
256 }
char i8
8-bit signed integer
Definition: config.hpp:72
mem_addr_t m_base
Load base address.
Definition: symtab.hpp:35
unsigned int u32
32-bit unsigned integer
Definition: config.hpp:102
chain< symbol > * m_table
Function symbol table.
Definition: symtab.hpp:37
i8 * m_path
Objective code file path.
Definition: symtab.hpp:33
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.
Definition: config.hpp:349