stacktracesimple

September 14, 2025 ยท View on GitHub

Demonstrates how to create a simple xtd::diagnostics::stack_trace class and iterate through its frames to obtain debugging and diagnostic information.

Sources

Build and run

Open "Command Prompt" or "Terminal". Navigate to the folder that contains the project and type the following:

xtdc run

Output

 File: /!---OMITTED---!/stack_trace_simple
 Line Number: 24

   Method: stack_trace_sample::my_protected_method()
   File: /!---OMITTED---!/stack_trace_simple
   Line Number: 14

     Method: stack_trace_sample::my_public_method()
     File: /!---OMITTED---!/stack_trace_simple
     Line Number: 9

       Method: main
       File: /!---OMITTED---!/stack_trace_simple
       Line Number: 44

High up the call stack, Method: main
High up the call stack, Line Number: 0