[PATCH] gdb: Remove cleanup from dw2_do_instantiate_symtab
Yao Qi
qiyaoltc@gmail.com
Tue Feb 6 16:40:00 GMT 2018
Andrew Burgess <andrew.burgess@embecosm.com> writes:
> I ran a few experiments using GCC 7.2, with -gdwarf-4 and
> -fdebug-type-sections added to the compiler flags (I believe
> IS_TYPE_UNIT_GROUP is related to -fdebug-type-sections) but I was
> unable to cause the IS_TYPE_UNIT_GROUP check to trigger, which would
> explain why my change didn't break anything.
>
Thanks for dig it deeper...
> So, assuming that the IS_TYPE_UNIT_GROUP can trigger in some cases,
> I've simply moved the creation of the dwarf2_queue_guard down the
> function until after the early return.
Yes, that looks right to me. Local object is initialized when it is
declared. Patch is good to me.
>
> I don't know if this violates the coding-standard. I know it used to
> be the case that variables had to be declared at the start of the
> block, but there are a few examples in this same file where this rule
> is not followed.
No, it doesn't. In C++, we can declare the variable when we'll use it.
--
Yao (齐尧)
More information about the Gdb-patches
mailing list