PStack
2.0
Stack trace printer for MSVC and GCC binaries
|
The main entry point for the PStack executable. More...
#include <psystem/framework/memory.hpp>
#include <psystem/framework/iomanip.hpp>
#include <psystem/dll/debug_help_dll.hpp>
#include <psystem/dbghelp_symbol_engine.hpp>
#include <psystem/module_info.hpp>
#include <psystem/module_address_map.hpp>
#include <psystem/process_info.hpp>
#include <psystem/symbol.hpp>
#include <psystem/thread_info.hpp>
#include <psystem/exception/base_exception.hpp>
#include <psystem/exception/system_exception.hpp>
#include <psystem/exception/ui_exception.hpp>
#include <pstack/debug_event_dumper.hpp>
#include <pstack/pstack_event_handler.hpp>
#include <pstack/pstack_options.hpp>
#include <proclib/debug_engine.hpp>
#include <proclib/demangle/demangle.hpp>
#include <proclib/process_debugger.hpp>
#include <algorithm>
#include <iostream>
Namespaces | |
anonymous_namespace{pstack.cpp} | |
Functions that are local to this compilation unit. | |
Functions | |
template<typename SymbolEngine > | |
void | anonymous_namespace{pstack.cpp}::output_stack_frame (SymbolEngine &symbol_eng, psystem::module_address_map const &modules, psystem::stack_frame const &frame) |
Prints a single stack from a stack trace to the console. More... | |
template<typename SymbolEngine > | |
void | anonymous_namespace{pstack.cpp}::output_stack_trace (SymbolEngine &symbol_eng, psystem::process_info *const proc, psystem::thread_info *const thrd) |
Prints one thread's call stack to the screen. More... | |
void | process_pid (proclib::debug_engine &engine, psystem::process_id_t const pid) |
Attach to a process and output stack traces for all threads. More... | |
int | main (int const argc, char const *argv[]) |
The main entry point for the PStack application. More... | |
The main entry point for the PStack executable.
int main | ( | int const | argc, |
char const * | argv[] | ||
) |
The main entry point for the PStack application.
See pstack::pstack_options for details on supported command-line options.
[in] | argc | The count of command-line arguments. |
[in] | argv | The array of strings that specify command-line arguments. |
void process_pid | ( | proclib::debug_engine & | engine, |
psystem::process_id_t const | pid | ||
) |
Attach to a process and output stack traces for all threads.
This is really the crux of the PStack application, as it attaches to a process, creates the utilities to analyze debugging symbols, and actually outputs the resulting stack traces.
[in] | engine | The debugging "engine" used to attach to a process and read information. |
[in] | pid | The system process ID (PID) of the process that will be examined. |
Document what exceptions this throws (there are many).
It would be nice if a problem with on PID didn't stop execution. Rearrange the exception handling a bit.