This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Fission patch 1/2


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]