Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the call stack for the current thread.
Provides information about a xtd::diagnostics::stack_frame, which represents a function call on the c...
Definition stack_frame.h:47
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.h:42
#define core_export_
Define shared library export.
Definition core_export.h:13
- Inheritance
- xtd::object → xtd::diagnostics::stack_frame
- Header
#include <xtd/diagnostics/stack_frame>
- Namespace
- xtd::diagnostics
- Library
- xtd.core
- Examples
- The following example demonstrates the use of the xtd::diagnostics::stack_frame class to provide the stack frame information for a stack trace.
#include <xtd/diagnostics/stack_frame>
#include <xtd/diagnostics/stack_trace>
#include <xtd/console>
void method2(int count) {
try {
if (count < 5)
throw;
}
}
void method1() {
try {
method2(4);
throw;
}
}
auto main() -> int {
try {
method1();
}
}
The exception that is thrown when one of the arguments provided to a method is not valid.
Definition argument_exception.h:24
static console_key_info read_key()
Obtains the next character or function key pressed by the user. The pressed key is displayed in the c...
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
Represents a stack trace, which is an ordered collection of one or more stack frames.
Definition stack_trace.h:40
The exception that is thrown when a method call is invalid for the object's current state.
Definition system_exception.h:18
The xtd::diagnostics namespace provides classes that allow you to interact with system processes,...
Definition assert_dialog_result.h:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
- Examples
- line_info.cpp, math_assert.cpp, math_assume.cpp, math_valid.cpp, stack_frame.cpp, and user_defined_exception.cpp.
|
| stack_frame () |
| Initializes a new instance of the xtd::diagnostics::stack_frame class.
|
|
| stack_frame (xtd::size skip_frame) |
| Initializes a new instance of the xtd::diagnostics::stack_frame class that corresponds to a frame above the current stack frame.
|
|
| stack_frame (bool need_file_info) |
| Initializes a new instance of the xtd::diagnostics::stack_frame class, optionally capturing source information.
|
|
| stack_frame (xtd::size skip_frame, bool need_file_info) |
| Initializes a new instance of the xtd::diagnostics::stack_frame class that corresponds to a frame above the current stack frame, optionally capturing source information.
|
|
| stack_frame (const xtd::string &file_name, xtd::size line_number) |
| Initializes a new instance of the xtd::diagnostics::stack_frame class that contains only the given file name, and line number.
|
|
| stack_frame (const xtd::string &file_name, xtd::size line_number, const xtd::string &method_name) |
| Initializes a new instance of the xtd::diagnostics::stack_frame class that contains only the given file name, line number, and method name.
|
|
| stack_frame (const xtd::string &file_name, xtd::size line_number, const xtd::string &method_name, xtd::size column_number) |
| Initializes a new instance of the xtd::diagnostics::stack_frame class that contains only the given file name, line number, and column number.
|
|
| stack_frame (const xtd::string &file_name, xtd::size line_number, xtd::size column_number) |
| Initializes a new instance of the xtd::diagnostics::stack_frame class that contains only the given file name, line number, and column number.
|
|
| stack_frame (const xtd::string &file_name, xtd::size line_number, const xtd::string &method_name, xtd::size column_number, xtd::size offset) |
| Initializes a new instance of the xtd::diagnostics::stack_frame class that contains only the given file name, line number, method name, column number, and offset.
|
|
| stack_frame (const xtd::source_location &source_location) |
| Initializes a new instance of the xtd::diagnostics::stack_frame class that contains only the given source location.
|
|
| stack_frame (const xtd::source_location &source_location, xtd::size offset) |
| Initializes a new instance of the xtd::diagnostics::stack_frame class that contains only the given given source location, and offset.
|
|
| stack_frame (xtd::null_ptr frame) |
| Initializes a new empty instance of the xtd::diagnostics::stack_frame.
|
|
|
bool | equals (const stack_frame &sf) const noexcept override |
| Indicates whether the current xtd::diagnostic::stack_frame is equal to another xtd::diagnostic::stack_frame.
|
|
virtual xtd::size | get_file_column_number () const noexcept |
| Gets the column number in the file that contains the code that is executing. This information is typically extracted from the debugging symbols for the executable.
|
|
virtual xtd::size | get_file_line_number () const noexcept |
| Gets the line number in the file that contains the code that is executing. This information is typically extracted from the debugging symbols for the executable.
|
|
virtual const xtd::string & | get_file_name () const noexcept |
| Gets the file name that contains the code that is executing. This information is typically extracted from the debugging symbols for the executable.
|
|
virtual const xtd::string & | get_method () const noexcept |
| Gets the method in which the frame is executing.
|
|
virtual xtd::size | get_native_offset () const noexcept |
| Gets the offset from the start of the native code for the method that is being executed.
|
|
virtual xtd::size | get_offset () const noexcept |
| Gets the offset from the start of the code for the method that is being executed.
|
|
xtd::string | to_string () const noexcept override |
| Builds a readable representation of the stack trace.
|
|
virtual bool | equals (const object &obj) const noexcept |
| Determines whether the specified object is equal to the current object.
|
|
template<typename object_a_t , typename object_b_t > |
static bool | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
| Determines whether the specified object instances are considered equal.
|
|
|
| object ()=default |
| Create a new instance of the ultimate base class object.
|
|
virtual size_t | get_hash_code () const noexcept |
| Serves as a hash function for a particular type.
|
|
virtual type_object | get_type () const noexcept |
| Gets the type of the current instance.
|
|
template<typename object_t > |
xtd::uptr< object_t > | memberwise_clone () const |
| Creates a shallow copy of the current object.
|
|
virtual bool | equals (const stack_frame &) const noexcept=0 |
| Indicates whether the current object is equal to another object of the same type.
|
|
template<typename object_a_t , typename object_b_t > |
static bool | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
| Determines whether the specified object instances are considered equal.
|
|
template<typename object_a_t , typename object_b_t > |
static bool | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept |
| Determines whether the specified object instances are the same instance.
|
|