This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] python/varobj: Fix accessing !IS_VALID EXPs
- From: Tom Tromey <tromey at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 10 Aug 2009 15:00:27 -0600
- Subject: Re: [patch] python/varobj: Fix accessing !IS_VALID EXPs
- References: <20090809214607.GA16019@host0.dyn.jankratochvil.net>
- Reply-to: tromey at redhat dot com
>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
Jan> the proposed gdb_assert in varobj_ensure_python_env is IMO correct.
Jan> I am not completely sure where/if other similiar fixups are required.
At least varobj_get_display_hint and varobj_set_visualizer.
If you add that assertion then free_variable needs some work.
It acquires the GIL to delete things. Perhaps these things need to be
deleted elsewhere now, like when the varobj is invalidated.
Jan> Despite those pointers stay != NULL.
Jan> I am still not completely sure it is stale-pointers-safe but it may be.
Yeah, it is not clear to me whether these fields are expected to remain
valid while the varobj is not.
If they are intended to be invalidated, I agree, we should free and
clear everything at the point of invalidation.
Based on the code I would guess that the current setup (leaving these
fields valid) is intentional. I don't understand why, though.
Tom