This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Fission patch 1/2
- From: Tom Tromey <tromey at redhat dot com>
- To: dje at google dot com (Doug Evans)
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 13 Apr 2012 11:01:43 -0600
- Subject: Re: [RFC] Fission patch 1/2
- References: <20120413072548.EAA5F2461B3@ruffy.mtv.corp.google.com>
>>>>> "Doug" == Doug Evans <dje@google.com> writes:
Doug> +void
Doug> +nullify_cleanup (struct cleanup *cleanup)
Doug> +{
Doug> + struct cleanup *c;
Doug> +
Doug> + for (c = cleanup_chain; c->next != cleanup; c = c->next)
Doug> + continue;
Doug> + c->function = null_cleanup;
Doug> +}
I'd rather not have a general facility for this kind of thing in
cleanups. I think it makes them even harder to reason about. Instead
the problem can be solved locally by making the particular cleanup work
conditionally.
Doug> + FIXME: As an implementation detail between our callers and us,
Doug> + USE_EXISTING_CU and KEEP are OK. But bubbling them up into their callers
Doug> + isn't as clean as I'd like. Having more callers with good names
Doug> + may be the way to go. */
I'd just remove it.
Doug> + if (free_cu_cleanup != NULL)
This sort of check is dangerous. A call to make_cleanup can return NULL
in some situations -- not this particular situation, but if someone
later modifies the code this can break.
It is better to keep a separate flag.
Doug> + The CU "per_cu" pointer is needed because offset alone is not enough to
Doug> + uniquely identify the type. A file may have multiple .debug_types sections,
Doug> + or the type may come from a DWO file.
I wonder if this fixes PR 13627.
Tom