Printed twice with setmirrortoconsole?

Oct 7, 2013 at 11:41pm

Printed twice with setmirrortoconsole?

Hi,

With the code below i get the error messages printed twice in my console. An idea how to prevent that?

void flop_init(void)  __attribute__ ((constructor));

void flop_init(void)
{
    t_atom rv;
    object_method_long(gensym("max")->s_thing, gensym("setmirrortoconsole"), 1, &rv);
}

void flop_backtrace(long m, long n)
{
    long i;
    void *a[32] = { NULL };
    long start = FLOP_CLAMP(m, 0, 32);
    long end = FLOP_CLAMP(n, 0, 32);
    long count = backtrace(a, end);
    char **strings = backtrace_symbols(a, count);
 
    for (i = start; i < count; i++) {
        post(">>> Backtrace / %s", strings[i]);
    }
 
    free(strings);
}

( https://github.com/nicolasdanet/Flop/blob/master/Sources/Flop/flopBacktrace.c#L114 )

com.cycling74.MaxMSP[611] >>> Backtrace / 0   flopBacktrace    0x00db9e2d flop_backtrace + 128
com.cycling74.MaxMSP[611] >>> Backtrace / 0   flopBacktrace    0x00db9e2d flop_backtrace + 128
com.cycling74.MaxMSP[611] >>> Backtrace / 1   flopBacktrace    0x00db9e9d flop_bang + 26
com.cycling74.MaxMSP[611] >>> Backtrace / 1   flopBacktrace    0x00db9e9d flop_bang + 26
com.cycling74.MaxMSP[611] >>> Backtrace / 2   MaxMSP           0x00065799 outlet_bang + 737
com.cycling74.MaxMSP[611] >>> Backtrace / 2   MaxMSP           0x00065799 outlet_bang + 737
com.cycling74.MaxMSP[611] >>> Backtrace / 3   MaxAPI           0x00f902e9 outlet_bang + 31
com.cycling74.MaxMSP[611] >>> Backtrace / 3   MaxAPI           0x00f902e9 outlet_bang + 31
com.cycling74.MaxMSP[611] >>> Backtrace / 4   button           0x17f3c3a7 jbutton_mousedown + 31
com.cycling74.MaxMSP[611] >>> Backtrace / 4   button           0x17f3c3a7 jbutton_mousedown + 31
com.cycling74.MaxMSP[611] >>> Backtrace / 5   MaxMSP           0x000bb18a object_method + 896
com.cycling74.MaxMSP[611] >>> Backtrace / 5   MaxMSP           0x000bb18a object_method + 896

(SDK 5.1.7 / Mac OX X 10.6.8 / Max 5.1.9)

#267407

You must be logged in to reply to this topic.