John Peacock <jpeacock@rowman.com> writes:
> My question is, how do people conventionally examine the contents of
> apr hashes from within the debugger? There are times when nothing but
> a printf() equivalent will do, so I am consider writing a debugger
> function, apr_hash_dump, which will just print out the stringified
> hash keys and values. I don't see a better way to understand why the
> hash is not being populated correctly for this one case.
FWIW, to examine hash contents, I usually do fancy casting, with lots
of help from my editor (macros and such). For example:
(gdb) p (const char *) ((((apr_hash_entry_t **) ctx->config->array)[6])->key)
$19 = 0x40094569 "config"
(gdb) p (const char *) ((((apr_hash_entry_t **) ctx->config->array)[6])->val)
$20 = 0x806a060 "x \006\bX\227\006\bHü\b\b"
(gdb)
In this case, I didn't know the right type for the value off the top
of my head, so it looks liek nonsense when viewed as a C string. But
whatever, you get the idea.
HTH,
-Karl
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Jan 31 20:15:40 2005