package back
- License: MIT
- Repository: https://github.com/laytan/back/blob/main
Index
Variables (0)
This section is empty.
Procedure Groups (1)
Types
Lines_Error ¶
Lines_Error :: enum int { None, Parse_Address_Fail, Addr2line_Unexpected_EOF, Addr2line_Output_Error, Addr2line_Unresolved, Fork_Limited = 11, Out_Of_Memory = 12, Invalid_Fd = 14, Pipe_Process_Limited = 24, Pipe_System_Limited = 23, Fork_Not_Supported = 38, Info_Not_Found, }
Related Procedures With Returns
- lines_const
- lines_n
- lines (procedure groups)
Result_Type ¶
Result_Type :: enum int { Both, Leaks, Bad_Frees, }
Related Procedures With Parameters
Trace_Const ¶
Related Procedures With Parameters
- lines_const
- lines (procedure groups)
Related Procedures With Returns
Tracking_Allocator ¶
Tracking_Allocator :: struct { backing: runtime.Allocator, internals_allocator: runtime.Allocator, allocation_map: map[rawptr]Tracking_Allocator_Entry, bad_free_array: [dynamic]Tracking_Allocator_Bad_Free_Entry, mutex: sync.Mutex, clear_on_free_all: bool, }
The backtrace tracking allocator is the same allocator as the core tracking allocator but keeps backtraces for each allocation.
See examples/allocator for a usage snippet.
Print results at the end using tracking_allocator_print_results().
Related Procedures With Parameters
Tracking_Allocator_Bad_Free_Entry ¶
Tracking_Allocator_Bad_Free_Entry :: struct { memory: rawptr, location: runtime.Source_Code_Location, backtrace: Trace_Const, }
Tracking_Allocator_Entry ¶
Tracking_Allocator_Entry :: struct { memory: rawptr, size: int, alignment: int, mode: runtime.Allocator_Mode, err: runtime.Allocator_Error, location: runtime.Source_Code_Location, backtrace: Trace_Const, }
Constants
BACKTRACE_SIZE ¶
BACKTRACE_SIZE :: #config(BACKTRACE_SIZE, 16)
Size of a constant backtrace, as used by the allocator for example.
FORCE_FALLBACK ¶
FORCE_FALLBACK :: #config(BACK_FORCE_FALLBACK, false)
Force the fallback instrumentation based implementation instead of debug info based.
OTHER_CUSTOM_INSTRUMENTATION ¶
OTHER_CUSTOM_INSTRUMENTATION :: #config(BACK_OTHER_CUSTOM_INSTRUMENTATION, false)
For targets that do not have native support (using debug info),
backtraces are done through instrumentation, Odin only allows one enter/exit instrumentation
procedure though, so you can set this to true, add your own instrumentation procs, and have
them call back.other_instrumentation_enter
and back.other_instrumentation_exit
to hook
up the backtraces.
The custom proc must have #force_inline
.
USE_FALLBACK ¶
USE_FALLBACK :: FORCE_FALLBACK || (ODIN_OS != .Darwin && ODIN_OS != .Linux && ODIN_OS != .Windows)
Variables
This section is empty.
Procedures
assertion_failure_proc ¶
assertion_failure_proc :: proc(prefix, message: string, loc: runtime.Source_Code_Location) -> ! {…}
lines_const ¶
lines_const :: proc(bt: Trace_Const, allocator := context.allocator) -> (out: []Line, err: Lines_Error) {…}
lines_destroy ¶
lines_destroy :: proc(lines: []Line, allocator := context.allocator) {…}
lines_n ¶
lines_n :: proc(bt: []rawptr, allocator := context.allocator) -> (out: []Line, err: Lines_Error) {…}
register_segfault_handler ¶
register_segfault_handler :: proc() {…}
trace ¶
trace :: proc() -> (bt: Trace_Const) {…}
trace_n ¶
trace_n :: proc(max_len: i32, allocator := context.allocator) -> []rawptr {…}
trace_n_destroy ¶
trace_n_destroy :: proc(b: []rawptr, allocator := context.allocator) {…}
tracking_allocator ¶
tracking_allocator :: proc(data: ^Tracking_Allocator) -> runtime.Allocator {…}
tracking_allocator_clear ¶
tracking_allocator_clear :: proc(t: ^Tracking_Allocator) {…}
tracking_allocator_destroy ¶
tracking_allocator_destroy :: proc(t: ^Tracking_Allocator) {…}
tracking_allocator_init ¶
tracking_allocator_init :: proc(t: ^Tracking_Allocator, backing_allocator: runtime.Allocator, internals_allocator := context.allocator) {…}
tracking_allocator_print_results ¶
tracking_allocator_print_results :: proc(t: ^Tracking_Allocator, type: Result_Type = .Both) {…}
tracking_allocator_proc ¶
tracking_allocator_proc :: proc( allocator_data: rawptr, mode: runtime.Allocator_Mode, size, alignment: int, old_memory: rawptr, old_size: int, loc := #caller_location, ) -> (result: []u8, err: runtime.Allocator_Error) {…}
Procedure Groups
lines ¶
lines :: proc{ lines_n, lines_const, }
Processes the message trying to get more/useful information. This adds file and line information if the program is running in debug mode.
If an error is returned the original message will be the result and is save to use.
Source Files
Generation Information
Generated with odin version dev-2024-10 (vendor "odin") Linux_amd64 @ 2024-10-02 09:04:27.163739539 +0000 UTC