Python stack trace structure and related algorithms.
More...
#include "../report_type.h"
#include <stdint.h>
Go to the source code of this file.
Python stack trace structure and related algorithms.
Definition in file python/stacktrace.h.
◆ sr_python_stacktrace_dup()
Creates a duplicate of the stacktrace.
- Parameters
-
stacktrace | The stacktrace to be copied. It's not modified by this function. |
- Returns
- This function never returns NULL. The returned duplicate must be released by calling the function sr_python_stacktrace_free().
◆ sr_python_stacktrace_free()
Releases the memory held by the stacktrace and its frames.
- Parameters
-
stacktrace | If the stacktrace is NULL, no operation is performed. |
◆ sr_python_stacktrace_from_json()
Deserializes stacktrace from JSON representation.
- Parameters
-
root | JSON value to be deserialized. |
error_message | On error, *error_message will contain the description of the error. |
- Returns
- Resulting stacktrace, or NULL on error.
◆ sr_python_stacktrace_get_reason()
Returns brief, human-readable explanation of the stacktrace.
◆ sr_python_stacktrace_init()
Initializes all members of the stacktrace structure to their default values. No memory is released, members are simply overwritten. This is useful for initializing a stacktrace structure placed on the stack.
◆ sr_python_stacktrace_new()
Creates and initializes a new stacktrace structure.
- Returns
- It never returns NULL. The returned pointer must be released by calling the function sr_python_stacktrace_free().
◆ sr_python_stacktrace_parse()
Parses a textual Python stacktrace and puts it into a structure. If parsing fails, the input parameter is not changed and NULL is returned.
- Parameters
-
input | Pointer to the string with the Python stack trace. If this function returns a non-NULL value, the input pointer is modified to point after the stacktrace that was just parsed. |
◆ sr_python_stacktrace_to_json()
Serializes stacktrace to string.
- Returns
- Newly allocated memory containing the textual representation of the provided stacktrace. Caller should free the memory when it's no longer needed.