Where do we put debug functions? debugger doesn't really help in dumping
complicated data structures like apr_table_t.
For example I wrote the following debug print:
/* dump the values of the table */
void debug_dump_table(apr_table_t *table, char *desc)
{
apr_array_header_t *arr = apr_table_elts(table);
apr_table_entry_t *entries = (apr_table_entry_t *)arr->elts;
int i;
fprintf(stderr, "!!! Dumping table:\n <%s>\n", desc);
for (i = 0; i < arr->nelts; i++) {
char *val = (char *)apr_table_get(table, entries[i].key);
fprintf(stderr, "!!! %s = %s\n", entries[i].key, val);
}
fprintf(stderr, "!!! </%s>\n", desc);
}
I guess I can also think of .gdbinit macro to do the same or even based
on this function.
But for this particular functions I suppose the best place is in apr
itself, not sure if I've missed some existing function.
_____________________________________________________________________
Stas Bekman JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide http://perl.apache.org/guide
mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]