1 #include "../include/process.hpp"
2 #include "../include/util.hpp"
26 sym =
new symbol(addr, nm);
30 catch (std::exception &x) {
241 tbl =
new symtab(path, base);
269 if (
likely(sym != NULL) )
virtual process & operator=(const process &)
Assignment operator.
virtual bool exists(mem_addr_t) const
Probe if a symbol exists.
virtual ~process()
Object destructor.
virtual u32 thread_count() const
Get the active thread count.
virtual process & cleanup_thread(pthread_t)
Cleanup libcsdbg-related thread resources upon thread cancellation.
chain< thread > * m_threads
Instrumented thread list.
This class represents a program/library function symbol.
virtual const i8 * lookup(mem_addr_t)
Lookup an address to resolve a symbol.
chain< symtab > * m_modules
Symbol table list.
virtual pid_t pid() const
Get the process ID.
Lightweight, templated, doubly-linked list (using XOR linking)
char i8
8-bit signed integer
virtual process & cache_add(mem_addr_t, const i8 *)
Add a symbol to the lookup cache.
virtual bool is_current() const
Check if this is the currently executing thread.
virtual thread * get_thread(pthread_t) const
Get a thread by ID.
#define likely(expr)
Offer a hint (positive) to the pipeline branch predictor.
This class represents a program/library symbol table (symtab section)
virtual u32 symbol_count() const
Get the number of symbols.
static void lock()
Lock the global access mutex.
This class represents a thread of execution in the instrumented process.
static void unlock()
Unlock the global access mutex.
static void dbg_error(const i8 *,...)
Print an error debug message on the standard error stream.
chain< symbol > * m_symcache
Lookup cache.
This class represents a process, its entire namespace and thread group.
virtual mem_addr_t addr() const
Get the symbol address.
virtual process * clone() const
Object virtual copy constructor.
process()
Object default constructor.
virtual process & add_module(const i8 *, mem_addr_t)
Add a symbol table to the namespace. The symbol table is loaded from a non stripped objective code fi...
virtual const i8 * name() const
Get the symbol name.
unsigned int u32
32-bit unsigned integer
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...
virtual const i8 * path() const
Get the objective code file path.
virtual const i8 * name() const
Get the thread name.
virtual const symbol * cache_lookup(mem_addr_t) const
Perform a cache lookup.
unsigned long long mem_addr_t
64-bit memory address
virtual thread * current_thread()
Get the currently executing thread.
virtual u32 module_count() const
Get the number of modules.
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.
virtual mem_addr_t base() const
Get the load base address.
#define __D_ASSERT(x)
Assertion macro.