[lug] good assert library

Chan Kar Heng karheng at softhome.net
Wed Sep 18 14:17:26 MDT 2002

thanks.. it's cool...

i tried this... gcc -rdynamic -g -O0 a.c

and i get a lot of hex addresses instead of function names...
is this the expected output?

anyway, would you know what gets sent across network in
the case where machine A runs an X opengl program that
resides on machine B? (remote X)...

either arguments of opengl function calls get sent or the
rendered images on the window get compressed and sent.
i'm wondering which... or maybe it works another way?

thanks in advance again.. :)



At 2002/09/16 11:46, you wrote:
>Chan Kar Heng wrote:
>>would anyone know of a good assert library??
>>i'm particularly looking for one that dumps the function call stack...
>>ansi assert merely reports the function that broke down.. but not
>>the caller.. :(
>>thanks in advance
>>Web Page:  http://lug.boulder.co.us
>>Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
>>Join us on IRC: lug.boulder.co.us port=6667 channel=#colug
>I use this in some of my testing code (don't forget the -rdynamic):
>#include <execinfo.h>
>#include <iostream>
>#ifdef _EXECINFO_H
>void show_stackframe()
>        void* trace[ 64 ];
>        char** messages = NULL;
>        int trace_size = 0;
>        cerr << "Begin Stack Frame Dump" << endl;
>        cerr << "(if useful symbols are not found, try recompiling "
>                << "with -rdynamic during link, and -g without -O#)"
>                << endl;
>        trace_size = backtrace( trace, 64 );
>        messages = backtrace_symbols( trace, trace_size );
>        for( int i = 0; i < trace_size; ++i ) {
>                cerr << "Traced: " << messages[i] << endl;
>        }
>        cerr << "End Stack Frame Dump" << endl;
>#endif // _EXECINFO_H

More information about the LUG mailing list