PStack  2.0
Stack trace printer for MSVC and GCC binaries
base_debug_event_listener.hpp
Go to the documentation of this file.
1 // ===-- include/proclib/base_debug_event_listener.hpp ---- -*- C++ -*- --=== //
2 // Copyright (c) 2014 Matt Bisson. All rights reserved.
3 
18 #pragma once
19 #ifndef PROCLIB_BASE_DEBUG_EVENT_LISTENER_HPP
20 #define PROCLIB_BASE_DEBUG_EVENT_LISTENER_HPP
21 
22 #include "proclib_ns.hpp"
23 
25 
26 namespace proclib {
27 
45 {
49 public:
54 
55 protected:
63 
67 public:
92  virtual bool create_process_event(
94  psystem::shared_handle<> const& file_handle,
95  CREATE_PROCESS_DEBUG_INFO const& info) noexcept;
96 
113  virtual bool create_thread_event(
115  CREATE_THREAD_DEBUG_INFO const& info) noexcept;
116 
137  virtual bool exception_event(
139  EXCEPTION_DEBUG_INFO const& info) noexcept;
140 
155  virtual bool exit_process_event(
157  EXIT_PROCESS_DEBUG_INFO const& info) noexcept;
158 
174  virtual bool exit_thread_event(
176  EXIT_THREAD_DEBUG_INFO const& info) noexcept;
177 
201  virtual bool load_dll_event(
203  psystem::shared_handle<> const& file_handle,
204  LOAD_DLL_DEBUG_INFO const& info) noexcept;
205 
218  virtual bool output_debug_string_event(
220  OUTPUT_DEBUG_STRING_INFO const& info) noexcept;
221 
240  virtual bool rip_event(
242  RIP_INFO const& info) noexcept;
243 
258  virtual bool unload_dll_event(
260  UNLOAD_DLL_DEBUG_INFO const& info) noexcept;
261 };
262 
263 } // namespace proclib
264 
265 #endif // PROCLIB_BASE_DEBUG_EVENT_LISTENER_HPP
Contains the library for debugging running processes.
Definition: base_debug_event_listener.hpp:26
virtual bool unload_dll_event(psystem::process_id_t pid, psystem::thread_id_t tid, UNLOAD_DLL_DEBUG_INFO const &info) noexcept
Invoked when the debugger encounters a DLL unload.
Definition: base_debug_event_listener.cpp:115
virtual bool load_dll_event(psystem::process_id_t pid, psystem::thread_id_t tid, psystem::shared_handle<> const &file_handle, LOAD_DLL_DEBUG_INFO const &info) noexcept
Invoked when the debugger sends an event to indicate that a DLL hase been loaded. ...
Definition: base_debug_event_listener.cpp:87
virtual bool rip_event(psystem::process_id_t pid, psystem::thread_id_t tid, RIP_INFO const &info) noexcept
Invoked when the debugger encounters a fatal application exit or debugger error.
Definition: base_debug_event_listener.cpp:106
#define noexcept
Replace keyword with something useful.
Definition: platform.hpp:71
virtual bool exit_process_event(psystem::process_id_t pid, psystem::thread_id_t tid, EXIT_PROCESS_DEBUG_INFO const &info) noexcept
Invoked when the debugger sends an event to indicate that the process has exited. ...
Definition: base_debug_event_listener.cpp:69
DWORD process_id_t
Data-type that stores a process ID (PID).
Definition: platform.hpp:241
base_debug_event_listener() noexcept
Construct the base_debug_event_listener instance.
Definition: base_debug_event_listener.cpp:26
virtual bool exit_thread_event(psystem::process_id_t pid, psystem::thread_id_t tid, EXIT_THREAD_DEBUG_INFO const &info) noexcept
Invoked when the debugger sends an event to indicate that a thread has exited.
Definition: base_debug_event_listener.cpp:78
Declare an RAII container for sharing system API handles (psystem::shared_handle).
virtual bool exception_event(psystem::process_id_t pid, psystem::thread_id_t tid, EXCEPTION_DEBUG_INFO const &info) noexcept
Invoked when the debugger sends an event to indicate some exception in normal process execution...
Definition: base_debug_event_listener.cpp:60
A polymorphic interface for detecting events received by the debugger.
Definition: base_debug_event_listener.hpp:44
virtual bool create_process_event(psystem::process_id_t pid, psystem::thread_id_t tid, psystem::shared_handle<> const &file_handle, CREATE_PROCESS_DEBUG_INFO const &info) noexcept
Invoked when the debugger sends an event to indicate process creation.
Definition: base_debug_event_listener.cpp:41
Share management of a single "handle" between multiple owners.
Definition: shared_handle.hpp:98
virtual bool create_thread_event(psystem::process_id_t pid, psystem::thread_id_t tid, CREATE_THREAD_DEBUG_INFO const &info) noexcept
Invoked when the debugger sends an event to indicate thread creation.
Definition: base_debug_event_listener.cpp:51
virtual ~base_debug_event_listener() noexcept
Clean up base_debug_event_listener resources.
Definition: base_debug_event_listener.cpp:31
The basic header file for the ProcLib namespce.
DWORD thread_id_t
Data-type that stores a thread ID (TID).
Definition: platform.hpp:247
virtual bool output_debug_string_event(psystem::process_id_t pid, psystem::thread_id_t tid, OUTPUT_DEBUG_STRING_INFO const &info) noexcept
Invoked when the debugger encounters a trace message from the debuggee.
Definition: base_debug_event_listener.cpp:97