From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11576 invoked by alias); 2 Apr 2018 16:17:58 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 11563 invoked by uid 89); 2 Apr 2018 16:17:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 02 Apr 2018 16:17:57 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 9F93A11666C; Mon, 2 Apr 2018 12:17:55 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id tiHy4s-f4XhY; Mon, 2 Apr 2018 12:17:55 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 6DA3611664F; Mon, 2 Apr 2018 12:17:55 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id B335683313; Mon, 2 Apr 2018 09:17:53 -0700 (PDT) Date: Mon, 02 Apr 2018 16:17:00 -0000 From: Joel Brobecker To: Simon Marchi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 2/5] Replace dw2_get_cu/dw2_get_cutu with methods of dwarf2_per_objfile Message-ID: <20180402161753.sq7cnm3shwbwtsgy@adacore.com> References: <20180401000444.13490-1-simon.marchi@polymtl.ca> <20180401000444.13490-3-simon.marchi@polymtl.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180401000444.13490-3-simon.marchi@polymtl.ca> User-Agent: NeoMutt/20170113 (1.7.2) X-SW-Source: 2018-04/txt/msg00041.txt.bz2 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) : > 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