Code review comment for lp:~ivaldi/midori/devpet-backtrace

Revision history for this message
André Stösel (ivaldi) wrote :

// valac bt.vala --pkg linux

void bar() {
    void* buffer[10];
    int num = Linux.backtrace (buffer, 10);
    string[] symbols = Linux.backtrace_symbols (buffer, num);

    if (symbols != null) {
        for (int i = 0; i < num; i++) {
            stdout.printf ("%s\n", symbols[i]);
        }
    } else {
        stdout.printf ("error: symbols is null\n");
    }
}

void foo() {
    bar ();
}

void main () {
    foo ();
}

PS: addr2line would be nice, indeed, but at the moment I have no time for it :/

« Back to merge proposal