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: [PATCH] gdb: Remove cleanup from dw2_do_instantiate_symtab


On Fri, Feb 2, 2018 at 11:53 PM, Andrew Burgess
<andrew.burgess@embecosm.com> wrote:
> When running the test gdb.dwarf2/dw2-bad-parameter-type.exp under
> valgrind, I see the following issue reported (on x86-64 Fedora):
>

Hi Andrew,
Thanks for fixing this issue.  I've seen this for some days, but didn't have
a chance to fix it.

> @@ -3132,14 +3167,15 @@ dw2_do_instantiate_symtab (struct dwarf2_per_cu_data *per_cu)
>  {
>    struct cleanup *back_to;

back_to is no longer used.  We can remove it.

>    struct dwarf2_per_objfile *dwarf2_per_objfile = per_cu->dwarf2_per_objfile;
> +  /* The destructor of this dwarf2_queue_guard frees any entries left on
> +     the queue.  */
> +  dwarf2_queue_guard q_guard;
>
>    /* Skip type_unit_groups, reading the type units they contain
>       is handled elsewhere.  */
>    if (IS_TYPE_UNIT_GROUP (per_cu))
>      return;
>
> -  back_to = make_cleanup (dwarf2_release_queue, NULL);
> -

I don't know much about dwarf2_queue.  The existing code only releases
 dwarf2_queue after this point (either the function returns or exception
is thrown), but your patch changes this to "releases dwarf2_queue" every
time dw2_do_instantiate_symtab is called.  Is it expected?

>    if (dwarf2_per_objfile->using_index
>        ? per_cu->v.quick->compunit_symtab == NULL
>        : (per_cu->v.psymtab == NULL || !per_cu->v.psymtab->readin))
> @@ -3165,8 +3201,6 @@ dw2_do_instantiate_symtab (struct dwarf2_per_cu_data *per_cu)
>    /* Age the cache, releasing compilation units that have not
>       been used recently.  */
>    age_cached_comp_units (dwarf2_per_objfile);
> -
> -  do_cleanups (back_to);
>  }
>

-- 
Yao (齐尧)


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