From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 89C783857C4A for ; Sun, 9 Aug 2020 22:28:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 89C783857C4A Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 079MSZCS000606 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 9 Aug 2020 18:28:40 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 079MSZCS000606 Received: from [10.0.0.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id C3CFB1E554; Sun, 9 Aug 2020 18:28:34 -0400 (EDT) Subject: Re: [PATCH] gdb: replace function pointer with `void *` data with function_view To: Tom Tromey , Simon Marchi via Gdb-patches Cc: Zaric@sourceware.org, Zoran References: <20200807182916.1873936-1-simon.marchi@polymtl.ca> <871rkikwh4.fsf@tromey.com> From: Simon Marchi Message-ID: <8066d71a-b989-210a-8fdd-ea861b85e988@polymtl.ca> Date: Sun, 9 Aug 2020 18:28:25 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <871rkikwh4.fsf@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Sun, 9 Aug 2020 22:28:35 +0000 X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-DCC: : antispam2020.polymtl.ca 1102; Body=1 Fuz1=1 Fuz2=1 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Aug 2020 22:28:45 -0000 On 2020-08-07 4:54 p.m., Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi via Gdb-patches writes: > > Simon> Replace the function pointer + `void *` parameters of > Simon> dwarf2_fetch_die_loc_sect_off and dwarf2_fetch_die_loc_cu_off with a > Simon> function_view parameter. Change call sites to use a lambda function. > Simon> This improves type-safety, so reduces the chances of errors. > > Simon> gdb/ChangeLog: > > Simon> * read.h (dwarf2_fetch_die_loc_sect_off, > Simon> dwarf2_fetch_die_loc_cu_off): Replace function pointer + > Simon> `void *` parameter with function_view. > Simon> * read.c (dwarf2_fetch_die_loc_sect_off, > Simon> dwarf2_fetch_die_loc_cu_off): Likewise. > Simon> * loc.c (get_frame_pc_for_per_cu_dwarf_call): Remove. > Simon> (per_cu_dwarf_call): Adjust. > Simon> (get_frame_address_in_block_wrapper): Remove. > Simon> (indirect_synthetic_pointer): Adjust. > Simon> (get_ax_pc): Remove. > Simon> (dwarf2_compile_expr_to_ax): Adjust. > > Looks good, thanks. > > Tom > Thanks, I pushed it. Simon