On Thu, Aug 7, 2008 at 9:07 AM, Xavier <shiningxc@gmail.com> wrote:
On Thu, Aug 7, 2008 at 3:41 PM, Dan McGee <dpmcgee@gmail.com> wrote:
(gdb) p d1 $1 = (const void *) 0x97b60f0 (gdb) p d2 $2 = (const void *) 0x97b60f0 (gdb) p d1->treename Attempt to dereference a generic pointer. (gdb) p ((pmdb_t)d1)->treename $3 = 0x97b60f0 "\020a{\t0a{\t\220p{\t" (gdb) p ((pmdb_t)d2)->treename $4 = 0x0
wtf, how is that even possible?
I'm not sure, I feel like GDB is doing something odd here considering d1 and d2 are identical addresses. Oh shoot, I see something now. :) I de-refed the instance type, not a pointer type. (gdb) p ((pmdb_t*)d1)->treename $1 = 0x891d130 "extra" (gdb) p ((pmdb_t*)d2)->treename $2 = 0x891d130 "extra" That makes more sense, but with those values, I have no idea why it is segfaulting. Anyone? I thought it might be due to strcmp() not liking the same exact string for both inputs, but a quick test put that fear to rest. -Dan