package blazesym
import "C"
import "unsafe"
type ElfSource struct {
source C.struct_blaze_symbolize_src_elf
}
func newElfSource(path string) *ElfSource {
source := C.struct_blaze_symbolize_src_elf{}
source.type_size = C.ulong(unsafe.Sizeof(source))
source.path = C.CString(path)
return &ElfSource{source: source}
}
type ElfSourceOption func(*ElfSource)
func ElfSourceWithDebugSyms(enabled bool) ElfSourceOption {
return func(es *ElfSource) {
es.source.debug_syms = C.bool(enabled)
}
}
func cleanupElfSourceStruct(elf *C.struct_blaze_symbolize_src_elf) {
C.free(unsafe.Pointer(elf.path))
}