PStack  2.0
Stack trace printer for MSVC and GCC binaries
process_debugger.cpp File Reference

Declare the debugger-to-process relationship. More...

Include dependency graph for process_debugger.cpp:

Classes

struct  proclib::process_debugger::dispatching_event_listener
 The implementation class for passing debugger events to registered listeners. More...
 

Namespaces

 proclib
 Contains the library for debugging running processes.
 

Macros

#define DEFINE_DISPATCH_EVENT_FUNC(listener_func, info_type)
 Macro for proclib::process_debugger::dispatching_event_listener method bodies. More...
 

Detailed Description

Declare the debugger-to-process relationship.

Author
Matt Bisson
Date
5 August, 2014
Since
ProcLib 2.0
Version
ProcLib 2.0

Macro Definition Documentation

#define DEFINE_DISPATCH_EVENT_FUNC (   listener_func,
  info_type 
)
Value:
bool \
process_debugger::dispatching_event_listener:: listener_func( \
psystem::process_id_t const pid, \
psystem::thread_id_t const tid, \
info_type const& info) \
noexcept \
{ \
bool ret = false; \
\
for (std::shared_ptr<base_debug_event_listener>& listener : m_listeners)\
{ \
ASSERT(listener); \
ret = listener->listener_func(pid, tid, info) || ret; \
} \
\
return ret; \
}
DWORD process_id_t
Data-type that stores a process ID (PID).
Definition: platform.hpp:241
DWORD thread_id_t
Data-type that stores a thread ID (TID).
Definition: platform.hpp:247

Macro for proclib::process_debugger::dispatching_event_listener method bodies.

Most of the methods are identical, and dispatch incoming events to listeners using the same function name. This macro is merely for unifying boilerplate code.

Parameters
listener_funcThe name of the function to dispatch.
info_typeData-type for event-specific details (e.g, RIP_INFO).
Todo:
We could probably do this with templates.