java stack trace structure and related algorithms.
More...
#include "../report_type.h"
#include <stdint.h>
Go to the source code of this file.
java stack trace structure and related algorithms.
Definition in file java/stacktrace.h.
◆ sr_java_stacktrace_cmp()
Compares two stacktraces.
- Returns
- Returns 0 if the stacktraces are same. Returns negative number if t1 is found to be 'less' than t2. Returns positive number if t1 is found to be 'greater' than t2.
◆ sr_java_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_java_stacktrace_free().
◆ sr_java_stacktrace_free()
Releases the memory held by the stacktrace and its frames.
- Parameters
-
stacktrace | If the stacktrace is NULL, no operation is performed. |
◆ sr_java_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_java_stacktrace_get_reason()
Returns brief, human-readable explanation of the stacktrace.
◆ sr_java_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_java_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_java_stacktrace_free().
◆ sr_java_stacktrace_parse()
Parses a textual stack trace 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 stacktrace. If this function returns a non-NULL value, this pointer is modified to point after the stacktrace that was just parsed. |
location | The caller must provide a pointer to an instance of sr_location here. The line and column members of the location are gradually increased as the parser handles the input, so the location should be initialized by sr_location_init() before calling this function to get reasonable values. When this function returns false (an error occurred), the structure will contain the error line, column, and message. |
- Returns
- A newly allocated stacktrace structure or NULL. A stacktrace struct is returned when at least one thread was parsed from the input and no error occurred. The returned structure should be released by sr_java_stacktrace_free().
◆ sr_java_stacktrace_to_json()
Serializes stacktrace to string. @returnes Newly allocated memory containing the textual representation of the provided stacktrace. Caller should free the memory when it's no longer needed.