From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by sourceware.org (Postfix) with ESMTPS id 5DD9E3858D28 for ; Wed, 25 Jan 2023 09:39:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5DD9E3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=foss.st.com Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30P9Pp19026158; Wed, 25 Jan 2023 10:39:18 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=41vzaJzsLCrE4UKSpYuzKMJ4HB1/JNKBnWaf41KzlJ8=; b=EDcaiR6kJhM7CeLXR7qQAen1liaPsNmdjqAWKXftJ8qvLEx0YMdPeRWDK9DV/Qwqer6S dLJOJ22Ev8tpLmCgUVRG8vX74sP+EPBb05h8I6QUrfyHDzCX355NOqQL9jA+0xcPhd9l FNkDrwRnItwgXJTSLAZMV8jebJhB2o8pNMF4apaw0qmzhm6qSJ28JHkHD1xmUakHKgxb OXfnV1bsy326xVQrOuV+wOZeJwYpxCOo93n6b6ZLPZvf686ErKZoK47zBbaJpAHwHA25 M8fVBOAhm4GmnEcHCi5jQSLHtqzi2Y/8ZKToR/WrlRbOZ0UZOekaSFSP8pbRjySyrRW0 Sw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3n89cgw7km-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 25 Jan 2023 10:39:17 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 8255610002A; Wed, 25 Jan 2023 10:39:17 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 7B1B42128D5; Wed, 25 Jan 2023 10:39:17 +0100 (CET) Received: from [10.252.16.216] (10.252.16.216) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.13; Wed, 25 Jan 2023 10:39:16 +0100 Message-ID: Date: Wed, 25 Jan 2023 10:39:16 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v3 1/2] gdb: dwarf2 generic implementation for caching function data Content-Language: en-US To: Tom Tromey , =?UTF-8?Q?Torbj=c3=b6rn_SVENSSON_via_Gdb-patches?= CC: , Yvan Roux References: <20230119102948.3069226-1-torbjorn.svensson@foss.st.com> <87fsc5x9ik.fsf@tromey.com> From: Torbjorn SVENSSON In-Reply-To: <87fsc5x9ik.fsf@tromey.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.252.16.216] X-ClientProxiedBy: EQNCAS1NODE3.st.com (10.75.129.80) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-25_04,2023-01-24_01,2022-06-22_01 X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,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 2023-01-20 20:59, Tom Tromey wrote: >>>>>> Torbjörn SVENSSON via Gdb-patches writes: > >> v2 -> v3: >> Addressed comments from Tom in >> https://sourceware.org/pipermail/gdb-patches/2023-January/195882.html > > Sorry, I'm afraid you missed a few. > >> +struct dwarf2_frame_fn_data >> +{ >> + /* The cookie to identify the custom function data by. */ >> + fn_prev_register cookie; > > The previous review mentioned changing the type of this, but honestly I > don't really care about that one, this is as good as anything now that > it's documented. > >> +/* See frame.h. */ >> + >> +void *dwarf2_frame_get_fn_data (frame_info_ptr this_frame, void **this_cache, >> + fn_prev_register cookie) > > gdb style puts the function name at the start of the line. > There are many examples in the source. > >> +void *dwarf2_frame_allocate_fn_data (frame_info_ptr this_frame, >> + void **this_cache, >> + fn_prev_register cookie, >> + unsigned long size) > > Here too. > >> +{ >> + struct dwarf2_frame_fn_data *fn_data = nullptr; >> + struct dwarf2_frame_cache *cache >> + = dwarf2_frame_cache (this_frame, this_cache); >> + >> + /* First try to find an existing object. */ >> + void *data = dwarf2_frame_get_fn_data (this_frame, this_cache, cookie); >> + if (data) >> + return data; > > It seems to me that there is no need to do this check. > IMO it's fine to just assert that it isn't found. > > thanks, > Tom Thanks for the review. I've corrected the points noted above. Still not sure why the check_GNU_style.py script in GCC contrib does not complain about this.. Anyway, is it okay for trunk with these changes or should I send a v4? Kind regards, Torbjörn