From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18264 invoked by alias); 17 Oct 2018 01:45:52 -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 127499 invoked by uid 89); 17 Oct 2018 01:45:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=UD:a.m, a.m, UD:ca, Hx-languages-length:1300 X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 17 Oct 2018 01:45:25 +0000 Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 5AB0F1E519; Tue, 16 Oct 2018 21:45:14 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=simark.ca; s=mail; t=1539740714; bh=+v2lYwEv4A/+iXklYNDgGBzzFdIrkzfUTigXo0bxNOc=; h=Subject:To:References:From:Date:In-Reply-To:From; b=TJK3ec581wNngZfYJnbk6J0bYsh0XHk8B7DcJiqHndaCayjVJipHqDjO6xzzX8PjZ uJ8acJa4R7T4rbr46S0DmOiL+TOFEd+X0FlBM6Di0lDANGJoekZMT6Oa+X31tiqlIy +TPPnU5SU5dEqa6XiQwYtakOz89C1XwWK1m4hD2w= Subject: Re: [PATCH 1/6] Use gdb:array_view in call_function_by_hand & friends To: Pedro Alves , gdb-patches@sourceware.org References: <20181015151115.6356-1-palves@redhat.com> <20181015151115.6356-2-palves@redhat.com> From: Simon Marchi Message-ID: <9f71d5fe-f30f-3470-5bbf-0ae21b93978a@simark.ca> Date: Wed, 17 Oct 2018 01:45:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20181015151115.6356-2-palves@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-SW-Source: 2018-10/txt/msg00361.txt.bz2 On 2018-10-15 11:11 a.m., Pedro Alves wrote: > This replaces a few uses of pointer+length with gdb::array_view, in > call_function_by_hand and related code. > > Unfortunately, due to -Wnarrowing, there are places where we can't > brace-initialize an gdb::array_view without an ugly-ish cast. To > avoid the cast, this patch introduces a gdb::make_array_view function. > Unit tests included. > > This patch in isolation may not look so interesting, due to > gdb::make_array_view uses, but I think it's still worth it. Some of > the gdb::make_array_view calls disappear down the series, and others > could be eliminated with more (non-trivial) gdb::array_view > detangling/conversion (e.g. code around eval_call). See this as a "we > have to start somewhere" patch. LGTM with two comments: - The function doc in infcall.h should be updated - This patch doesn't build for me, probably just one forgotten spot: CXX spu-tdep.o /home/simark/src/binutils-gdb/gdb/spu-tdep.c: In function ‘void flush_ea_cache()’: /home/simark/src/binutils-gdb/gdb/spu-tdep.c:2043:69: error: could not convert ‘0’ from ‘int’ to ‘gdb::array_view’ call_function_by_hand (value_from_pointer (type, addr), NULL, 0, NULL); ^ Simon