From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by sourceware.org (Postfix) with ESMTPS id A52AC3858C39 for ; Thu, 24 Aug 2023 11:37:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A52AC3858C39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-3fee600dce6so48016695e9.1 for ; Thu, 24 Aug 2023 04:37:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692877035; x=1693481835; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7KLSQcSDiHJJ/yudSxExuY8lRQUsFUqDdWHEHePwLfE=; b=S80RaL4S/uo5xSrsIiPRODDTpBsX82RpehNTpsDTkZjVfY9Kyrk4SLPzKY1WK6byf+ QtV5VuRnbYzOCFFZdlC3+a6df387nivTYlzmYIqJVeKPYuwRVmSlW2i1P748NbnJWPS7 Ng6keBUAnWkrNE1omf5ScF0Hr7XmEIHrMQ1swUmub7GtA6vtDA5Ie0Yu1GZrxGP9DVN/ cABnGmYosEgzpDunHqKw/zdmgoW0hDv0FxWs8eJnJsMrD747LURMMXaF8DyvSWFgJIIu CNQHByX8oCIC+d9l9r+w4cQNE8S6DmBVSikwya9McO0mhTi2454+3DB4qWcidRV1OnoI M7kQ== X-Gm-Message-State: AOJu0YyWkQZB/rLQn9DMzjYgWxW48dVs5Np1ldG47FgwuQ4FZQnEQfSo xB5BZKozdHk4Qx+qKgPWX/boAXU43EszeA== X-Google-Smtp-Source: AGHT+IEGD670P2+dfFpbegBXXrkTKJ088KhUcgTKoWqy3vwz5PET7jL55y/IE7r/ei1DufwULIJ6MA== X-Received: by 2002:a1c:4c12:0:b0:401:b2c7:349e with SMTP id z18-20020a1c4c12000000b00401b2c7349emr14253wmf.17.1692877035107; Thu, 24 Aug 2023 04:37:15 -0700 (PDT) Received: from ?IPV6:2001:8a0:f90f:8600:6294:f9ad:8f9c:9ce4? ([2001:8a0:f90f:8600:6294:f9ad:8f9c:9ce4]) by smtp.gmail.com with ESMTPSA id 14-20020a05600c024e00b003fe2bea77ccsm502317wmj.5.2023.08.24.04.37.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Aug 2023 04:37:14 -0700 (PDT) Message-ID: Date: Thu, 24 Aug 2023 12:37:11 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH 2/2] [gdb/build] Return const reference in thread_info_to_thread_handle Content-Language: en-US To: Tom de Vries , gdb-patches@sourceware.org References: <20230821105356.869-1-tdevries@suse.de> <20230821105356.869-2-tdevries@suse.de> <4917ef2f-f50a-efc0-59a8-30e86d5ac53b@palves.net> <947d8961-598d-5680-185c-f583d69124c8@suse.de> <6e0dd204-8e42-677e-2f5f-cc40c3d780b3@palves.net> <7ec600eb-c472-d85e-f186-1c4dddbd8cdf@suse.de> From: Pedro Alves In-Reply-To: <7ec600eb-c472-d85e-f186-1c4dddbd8cdf@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 24/08/23 07:21, Tom de Vries wrote: >>> + >>> +static void >>> +target_debug_print_gdb_array_view_const_gdb_byte (gdb::array_view &vector) >> >> array_views should be passed by value normally (because they're small).  Did you run into something >> that forced this to be a reference?  Or was it just copied from the vector case?  If it >> works, we should just drop the &. >> > > Done. > >> Also, one of the points of array_view is that you can pass a vector as array_view >> argument, like you can pass std::string as string_view argument -- would it work to make >> target_debug_print_const_gdb_byte_vector_r call this new >> target_debug_print_gdb_array_view_const_gdb_byte instead of duplicating that code? >> > > Done, updated version attached. Thanks. Approved-By: Pedro Alves