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 PATCH] Introduce dwarf2_cu::get_builder


On 2018-10-23 14:57, Keith Seitz wrote:
This patch is an attempt to deal with a variety of bugs reported where
GDB segfaults attempting to access a dwarf2_cu's builder.  In certain
circumstances, this builder can be NULL.

The approach taken here is to save the ancestor CU into the dwarf2_cu of
all CUs with DIEs that are "imported."  This can happen whenever
follow_die_offset and friends are called. This essentially introduces a
chain of CUs that caused the importation of a DIE from a CU.  Whenever
a builder is requested of a CU that has none, the ancestors are searched
for the first one with a builder.

The bulk of the patch is relatively mindless text conversion from
"cu->builder" to "cu->get_builder ()".  I've included one test which
was derived from one (of the many) bugs reported on the issue in both
sourceware and Fedora bugzillas.

I'm submitting this as an RFC rather than an actual patch because of the lack of coverage testing for all the places where get_builder() is used.

Hi Keith,

I can't give meaningful comments yet, because this deals with cases I'm not really used to.

With the way you did it, I'm confident that the behavior will not change for existing cases, since we will end up using the same builder as before. Only in those cases where it would have been NULL (and thus would have caused a segfault) will the behavior change. And if it gives some good results for these cases, then it seems right.

I noticed there were still some "naked" access to builder (places that don't use get_builder). fixup_go_packaging is one, for example. Is it expected or should they be converted too?

Simon


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