This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/5] Replace dw2_get_cu/dw2_get_cutu with methods of dwarf2_per_objfile
Hi Simon,
On Sat, Mar 31, 2018 at 08:04:41PM -0400, Simon Marchi wrote:
> Those two functions look like good candidates to become methods of
> dwarf2_per_objfile. I did that, and added get_tu as well. When
> replacing usages of dw2_get_cutu, I changed some instances to get_cutu
> and others to get_cu, when appropriate (when we know we want a CU and
> not a TU).
>
> gdb/ChangeLog:
>
> * dwarf2read.h (struct signatured_type): Forward declare.
> (struct dwarf2_per_objfile) <get_cutu, get_cu, get_tu>:
> New methods.
> * dwarf2read.c (dwarf2_per_objfile::get_cutu): Rename from...
> (dw2_get_cutu): ...this.
> (dwarf2_per_objfile::get_cu): Rename from...
> (dw2_get_cu): ...this.
> (dwarf2_per_objfile::get_tu): New.
> (create_addrmap_from_index): Adjust.
> (create_addrmap_from_aranges): Adjust.
> (dw2_find_last_source_symtab): Adjust.
> (dw2_map_symtabs_matching_filename): Adjust.
> (dw2_symtab_iter_next): Adjust.
> (dw2_print_stats): Adjust.
> (dw2_expand_all_symtabs): Adjust.
> (dw2_expand_symtabs_with_fullname): Adjust.
> (dw2_expand_marked_cus): Adjust.
> (dw_expand_symtabs_matching_file_matcher): Adjust.
> (dw2_map_symbol_filenames): Adjust.
> (dw2_debug_names_iterator::next): Adjust.
> (dwarf2_initialize_objfile): Adjust.
> (set_partial_user): Adjust.
> (dwarf2_build_psymtabs_hard): Adjust.
Got time to look at this one to (and discover the dw2_get_cutu function).
The patch looks good to me. Not only that, I see that you changed some
of the "get_cutu" calls to either ::get_cu or ::get_tu when there was
enough context to know which one it was that we were handling. This is
a very nice enhancement, in my opinion.
That's all the time I have to review this patch series for now.
I may or may not be able to review the rest, so please anyone feel
free to take a look.
--
Joel