libcsdbg  1.28
C++ exception (and generic) stack trace debug library
csdbg::thread Class Reference

This class represents a thread of execution in the instrumented process. More...

#include <thread.hpp>

+ Inheritance diagram for csdbg::thread:
+ Collaboration diagram for csdbg::thread:

Public Member Functions

 thread (const i8 *=NULL)
 Object constructor. More...
 
 thread (const thread &)
 Object copy constructor. More...
 
virtual ~thread ()
 Object destructor. More...
 
virtual threadclone () const
 Object virtual copy constructor. More...
 
virtual const i8name () const
 Get the thread name. More...
 
virtual pthread_t handle () const
 Get the thread handle. More...
 
virtual i32 lag () const
 Get the size (call depth) of the simulated call stack with respect to the real call stack, the number of calls that must be popped off the simulated stack to match the real one. More...
 
virtual threadset_name (const i8 *)
 Set the thread name. More...
 
virtual threadoperator= (const thread &)
 Assignment operator. More...
 
virtual bool is_current () const
 Check if this is the currently executing thread. More...
 
virtual u32 call_depth () const
 Get the size (call depth) of the simulated call stack. More...
 
virtual const callbacktrace (u32) const
 Peek at the simulated call stack. More...
 
virtual threadcalled (mem_addr_t, mem_addr_t, const i8 *)
 Simulate a function call. More...
 
virtual threadreturned ()
 Simulate a function return. More...
 
virtual threadunwind ()
 Unwind the simulated call stack to meet the real call stack. More...
 
virtual threadforeach (void(*)(u32, call *)) const
 Traverse the simulated stack with a callback for each call. More...
 
- Public Member Functions inherited from csdbg::object
virtual ~object ()=0
 To be implemented. More...
 
virtual const i8class_name () const
 Query the class name of an object descending from csdbg::object. More...
 

Protected Attributes

i8m_name
 Thread name. More...
 
pthread_t m_handle
 Thread handle. More...
 
stack< call > * m_stack
 Simulated call stack. More...
 
i32 m_lag
 The number of calls that must be popped off the simulated stack for it to match the real one. More...
 

Detailed Description

This class represents a thread of execution in the instrumented process.

An object of this class is an abstraction of the actual threading system. It stores the simulated call stack and other thread specific data and it is used to track a thread execution. The simulated call stack can be traversed using simple callbacks and method thread::foreach. Currently only POSIX threads are

supported

Todo:
Use std::thread (C++11) class for portability

Definition at line 27 of file thread.hpp.


The documentation for this class was generated from the following files: