improved my 'prologue/epilogue tracer' since my last post.. this one is WAY better, absolutely sick never knew until now, that i could do this..
using gcc -finstrument-functions, you can add a hook to the prologue and epilogue of EVERY function/call/inline function/macro that you actually compile.... so now i dont even need to edit the source code to include my debugging info.. this trace resulted in a 500MB file within 1 minute of running my bot, lmao.. so i added a "trace only" config option, which means, i can trace based on a per-bot basis... such as:
efnet trace on
so now, all processing specific to that bot struct, will get logged to the trace file.. ill post some of the trace later.. here's an example code to illustrate how beast -finstrument-functions is..
#include <stdio.h>
void __cyg_profile_func_enter (void *this_fn, void *call_site)
__attribute__ ((no_instrument_function));
void __cyg_profile_func_exit (void *this_fn, void *call_site)
__attribute__ ((no_instrument_function));
void
__cyg_profile_func_enter (void *this_fn, void *call_site)
{
printf ("enter: addr=%p\n", this_fn);
return;
}
void
__cyg_profile_func_exit (void *this_fn, void *call_site)
{
printf ("exit: addr=%p\n", this_fn);
return;
}
void
foo (void)
{
puts ("foo called");
return;
}
int
main (int argc, char **argv[])
{
puts ("main called");
foo ();
}
the __cyg name is apparently based on cygnus, who developed that code which was implemented into gcc...
thankful something like that exists, really gives you a TON of new options regarding debugging etc.
peace