Create the stack trace of a thread indexed by its ID and append it to a string.
724 return const_cast<tracer&
> (*this);
727 const i8 *nm = thr->name();
730 dst.append(
"at %s thread (0x%lx) {\r\n", nm, thr->handle());
733 for (
i32 i = thr->call_depth() - 1;
likely(i >= 0); i--) {
734 const call *cur = thr->backtrace(i);
735 dst.append(
" at %s", cur->name());
739 if (
likely (prev < thr->call_depth()) ) {
740 const call *caller = thr->backtrace(prev);
744 addr2line(dst, path, cur->site() - base);
752 return const_cast<tracer&
> (*this);
virtual string & append(const string &)
Append a string.
char i8
8-bit signed integer
virtual thread * get_thread(pthread_t) const
Get a thread by ID.
process * m_proc
Process handle.
#define likely(expr)
Offer a hint (positive) to the pipeline branch predictor.
static void lock()
Lock the global access mutex.
static void unlock()
Unlock the global access mutex.
tracer()
Object default constructor.
unsigned int u32
32-bit unsigned integer
static string & addr2line(string &, const i8 *, mem_addr_t)
Given an address in an objective code file, extract from the gdb-related debug information, the equivalent source code file name and line and append it to a string buffer.
int i32
32-bit signed integer
virtual const i8 * ilookup(mem_addr_t, mem_addr_t &) const
Inverse lookup. Find the module (executable or DSO library) that defines a symbol and return its path...
unsigned long long mem_addr_t
64-bit memory address
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.