struct dive_table dive_table

Lubomir I. Ivanov neolit123 at gmail.com
Wed Apr 17 09:58:09 PDT 2013


On 17 April 2013 19:30, Amit Chaudhuri <amit.k.chaudhuri at gmail.com> wrote:
> At parse-xml.c : 31 there is this: struct dive_table dive_table
>
> I've written a very nasty piece of code which I need to debug.  So I'm
> trying to use gdb to examine dive_table.  But using 'p dive_table' generates
> an error: "Attempt to use a type name as an expression".
>
> On #gdb someone suggested this: p *(struct dive_table*)0x6be970 which works.
> But it requires working out the address of dive_table which I did using
> printf.  And it's quite long winded. Short of renaming variables anyone got
> a neater method?
>
> [I believe there is a bug filed for this in gdb land somewhere]
>

have you tried:
watch dive_table

Hardware watchpoint 1: dive_table

Old value = {nr = 0, allocated = 0, preexisting = 0, dives = 0x0}
New value = {nr = 0, allocated = 0, preexisting = 0, dives = 0x36fa208}
record_dive_to_table (dive=0x43496a0, table=0x4a93e0) at parse-xml.c:60
60                      table->allocated = allocated;

lubomir
--


More information about the subsurface mailing list