Quite excited by the prospects of easier debugging of CGO applications 
using runtime.SetCgoSymbolizer at work,
since we must necessarily use CGO, and it's usually been rather painful to 
use a mix of delve, perf, and gdb to debug
these programs.

The documentation for this is rather (necessarily) complex, and I was 
wondering if there is a "simple" example around,
aside from the tests in the Go repo itself?

I'm aware of: https://github.com/ianlancetaylor/cgosymbolizer

It looks great, but doesn't seem to work at all with a contrived example I 
wrote[1]. I'm aware it's labelled experiment,
but perhaps Ian may comment. Mostly, I am asking on this list before I dive 
into the deep end and try and write my
own handler, which will no doubt be a very large undertaking.

- Derek

[1] Example as follows:

*crash.go*:
package main

/*
void crash_now(int a, char *b);
*/
import "C"

import (
    "fmt"
    _ "github.com/ianlancetaylor/cgosymbolizer"
)

func crash() {
    C.crash_now(1, C.CString("some string"))
}

func main() {
    fmt.Println("Pre-crash")
    crash()
    fmt.Println("Post-crash")
}

*crash.c*:
#include <stdio.h>

void crash_now(int a, char *b) {
    int *thing = NULL;
    fprintf(stderr, "Here: %d %s\n", *thing + a, b);
}

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to