From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 117262 invoked by alias); 13 Jan 2020 23:13:30 -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 117253 invoked by uid 89); 13 Jan 2020 23:13:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 13 Jan 2020 23:13:29 +0000 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 00DNDJFq023998 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Jan 2020 18:13:24 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 00DNDJFq023998 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1578957205; bh=0XPZ5/dGKpgdupCbhpvzm3IyEQeDqj4zgCunnkIGvBE=; h=Subject:To:References:From:Date:In-Reply-To:From; b=EQ+CnmfhbVr3gdp5W/IqV700E71I9m+S2U9N6QIU4vURjzAiNd0KEzAZlftR9BxQM ukyjl+HcqMQ7J7WlJB6kdfQ92x/q5UTlw447W++23IhAP5cprOvFxziVMASkl+BbV1 a8YloWZy6nM7XAmfH+/dq7o1MOPdG/Zr7MbF/QdQ= Received: from [172.16.0.95] (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id AA75C1E4B2; Mon, 13 Jan 2020 18:13:19 -0500 (EST) Subject: Re: [PATCH] gdb: use std::vector instead of alloca in core_target::get_core_register_section To: Pedro Alves , gdb-patches@sourceware.org References: <20200112201729.489317-1-simon.marchi@polymtl.ca> From: Simon Marchi Message-ID: Date: Mon, 13 Jan 2020 23:21:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2020-01/txt/msg00359.txt.bz2 On 2020-01-13 5:04 p.m., Pedro Alves wrote: > On 1/13/20 8:02 PM, Simon Marchi wrote: >> On 2020-01-13 2:40 p.m., Pedro Alves wrote: >>> On 1/12/20 8:17 PM, Simon Marchi wrote: >>>> - contents = (char *) alloca (size); >>>> - if (! bfd_get_section_contents (core_bfd, section, contents, >>>> + std::vector contents (size); >>>> + if (! bfd_get_section_contents (core_bfd, section, contents.data (), >>>> (file_ptr) 0, size)) >>>> { >>> >>> gdb::byte_vector >> >> I used std::vector because the original code also used char, and >> m_core_vec->core_read_registers also accepts a char * (although I >> could/should have used gdb::char_vector anyway). However, gdb_byte >> probably makes more sense here. I would push the patch below as a fixup >> if it looks good to you. > > It does LGTM, thanks! > > Pedro Alves > Thanks, it is now pushed. Simon