This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] gdb: Remove cleanup from dw2_do_instantiate_symtab
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Andrew Burgess <andrew dot burgess at embecosm dot com>
- Cc: GDB Patches <gdb-patches at sourceware dot org>
- Date: Mon, 5 Feb 2018 14:45:13 +0000
- Subject: Re: [PATCH] gdb: Remove cleanup from dw2_do_instantiate_symtab
- Authentication-results: sourceware.org; auth=none
- References: <20180202235354.6468-1-andrew.burgess@embecosm.com>
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 (齐尧)