satyr 0.43
Loading...
Searching...
No Matches
stacktrace.h File Reference

Stack trace. More...

#include "report_type.h"
#include <json.h>

Go to the source code of this file.

Data Structures

struct  sr_stacktrace
 

Enumerations

enum  sr_bthash_flags { SR_BTHASH_NORMAL = 1 << 0 , SR_BTHASH_NOHASH = 1 << 1 }
 

Functions

struct sr_stacktracesr_stacktrace_parse (enum sr_report_type type, const char *input, char **error_message)
 
char * sr_stacktrace_to_short_text (struct sr_stacktrace *stacktrace, int max_frames)
 
struct sr_threadsr_stacktrace_find_crash_thread (struct sr_stacktrace *stacktrace)
 
struct sr_threadsr_stacktrace_threads (struct sr_stacktrace *stacktrace)
 
void sr_stacktrace_set_threads (struct sr_stacktrace *stacktrace, struct sr_thread *threads)
 
char * sr_stacktrace_to_json (struct sr_stacktrace *stacktrace)
 
struct sr_stacktracesr_stacktrace_from_json (enum sr_report_type, json_object *root, char **error_message)
 
struct sr_stacktracesr_stacktrace_from_json_text (enum sr_report_type, const char *input, char **error_message)
 
char * sr_stacktrace_get_reason (struct sr_stacktrace *stacktrace)
 
char * sr_stacktrace_get_bthash (struct sr_stacktrace *stacktrace, enum sr_bthash_flags flags)
 
void sr_stacktrace_free (struct sr_stacktrace *stacktrace)
 

Detailed Description

Stack trace.

Definition in file stacktrace.h.

Enumeration Type Documentation

◆ sr_bthash_flags

enum sr_bthash_flags

Definition at line 56 of file stacktrace.h.

Function Documentation

◆ sr_stacktrace_find_crash_thread()

struct sr_thread * sr_stacktrace_find_crash_thread ( struct sr_stacktrace * stacktrace)

Returns the thread structure that (probably) caused the crash.

◆ sr_stacktrace_free()

void sr_stacktrace_free ( struct sr_stacktrace * stacktrace)

Releases all the memory associated with the stacktrace pointer.

◆ sr_stacktrace_from_json()

struct sr_stacktrace * sr_stacktrace_from_json ( enum sr_report_type,
json_object * root,
char ** error_message )

Deserialize stacktrace from its json representation.

◆ sr_stacktrace_from_json_text()

struct sr_stacktrace * sr_stacktrace_from_json_text ( enum sr_report_type,
const char * input,
char ** error_message )

Deserialize stacktrace from its json representation.

◆ sr_stacktrace_get_bthash()

char * sr_stacktrace_get_bthash ( struct sr_stacktrace * stacktrace,
enum sr_bthash_flags flags )

Returns hash of a backtrace. This is a hash in the usual sense that the same stacktraces always have the same hash while two distinct stacktraces have negligible probability of having the same hash. The string is allocated by g_malloc().

◆ sr_stacktrace_get_reason()

char * sr_stacktrace_get_reason ( struct sr_stacktrace * stacktrace)

Returns brief, human-readable explanation of the stacktrace.

◆ sr_stacktrace_parse()

struct sr_stacktrace * sr_stacktrace_parse ( enum sr_report_type type,
const char * input,
char ** error_message )

Parses the stacktrace pointed to by input. You need to provide the correct stacktrace type in the first parameter.

◆ sr_stacktrace_set_threads()

void sr_stacktrace_set_threads ( struct sr_stacktrace * stacktrace,
struct sr_thread * threads )

Set the threads linked list pointer.

◆ sr_stacktrace_threads()

struct sr_thread * sr_stacktrace_threads ( struct sr_stacktrace * stacktrace)

Returns pointer to the first thread.

◆ sr_stacktrace_to_json()

char * sr_stacktrace_to_json ( struct sr_stacktrace * stacktrace)

Convert stacktrace to json and return it as text.

◆ sr_stacktrace_to_short_text()

char * sr_stacktrace_to_short_text ( struct sr_stacktrace * stacktrace,
int max_frames )

Returns short textual representation of given stacktrace. At most max_frames are printed. Caller needs to free the result using g_free() afterwards.