From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 4B500388A018 for ; Thu, 2 Apr 2020 14:57:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4B500388A018 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (unknown [192.222.164.54]) (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 97A761E581; Thu, 2 Apr 2020 10:57:55 -0400 (EDT) Subject: Re: [PATCH] gdb: use bfd_get_section_contents to read section contents in, is_linked_with_cygwin_dll To: Simon Marchi , Tom Tromey , Pedro Alves via Gdb-patches Cc: Pedro Alves , Simon Marchi , Jon Turney References: <20200316170845.184386-1-simon.marchi@polymtl.ca> <20200316170845.184386-7-simon.marchi@polymtl.ca> <0b76517a-f6dd-0aa8-17fb-ce5a9accbf42@redhat.com> <87ftdmvx85.fsf@tromey.com> <6b6b7467-2db4-56c9-dd98-3082b7b68abe@polymtl.ca> From: Simon Marchi Message-ID: <43820f9d-8ed1-b22f-2c30-a6141757aa1e@simark.ca> Date: Thu, 2 Apr 2020 10:57:55 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <6b6b7467-2db4-56c9-dd98-3082b7b68abe@polymtl.ca> Content-Type: text/plain; charset=utf-8 Content-Language: en-US-large Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-24.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 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: Thu, 02 Apr 2020 14:57:57 -0000 On 2020-04-02 10:55 a.m., Simon Marchi via Gdb-patches wrote: > diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c > index 9c5dfd183bfa..9b7dc1d12b26 100644 > --- a/gdb/windows-tdep.c > +++ b/gdb/windows-tdep.c > @@ -1005,18 +1005,17 @@ is_linked_with_cygwin_dll (bfd *abfd) > bfd_vma idata_addr > = pe_data (abfd)->pe_opthdr.DataDirectory[PE_IMPORT_TABLE].VirtualAddress; > > - /* Map the section's data. */ > - bfd_size_type idata_size; > - const gdb_byte *const idata_contents > - = gdb_bfd_map_section (idata_section, &idata_size); > - if (idata_contents == nullptr) > + /* Get the section's data. */ > + gdb::byte_vector idata_contents; > + if (!gdb_bfd_get_section_contents(abfd, idata_section, &idata_contents)) Missing space here, consider it fixed. Simon