From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id eT++IOy6fWqOQyMAWB0awg (envelope-from ) for ; Thu, 13 Aug 2026 08:39:08 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=s1jfrryk; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 814FA1E166; Thu, 13 Aug 2026 08:39:08 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 829821E033 for ; Thu, 13 Aug 2026 08:39:07 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8A13A4BA798D for ; Thu, 13 Aug 2026 12:39:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8A13A4BA798D Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=s1jfrryk Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id D33394BA23E8 for ; Thu, 13 Aug 2026 12:38:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D33394BA23E8 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D33394BA23E8 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786624717; cv=none; b=LP7hugxjhUhuk3dXc5hP/p7z3jNLLtylWuCgtQGI08c1cFgHDO255iru9pNXlER3iSenOBVIkgP4svO5MOYsJtN5MbH5sPzHdS+c0VQldmg+qilPJOhYnDjfeLt2icmcBdCrPUHni1J7au/cYivc5Hgs9kxQGamn8RyOs1MGxPg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786624717; c=relaxed/simple; bh=dHnVKonvZQLzn2eJ0VtOytyDGMLYkLNn0MApBDneSoA=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=qc7zqtrYdwEy4Ug/5c73j4UvKqcMMSgAFIm+JTk8JThHtGebLENEoB+epmjrjtIngJia/shAggnvD+CfOM/EB0jVCieEmlNhxVyfDcMEuJiX/QxvQuBuqXqNv85u4rLzcBvxFVXQMeaOJ9N42aTv6Pza/sZiHv+p8sDgAlk0EZI= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=s1jfrryk DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D33394BA23E8 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1CD5A1596; Thu, 13 Aug 2026 05:38:32 -0700 (PDT) Received: from [10.1.23.150] (K775M2XVT2.cambridge.arm.com [10.1.23.150]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D24F53F632; Thu, 13 Aug 2026 05:38:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1786624716; bh=dHnVKonvZQLzn2eJ0VtOytyDGMLYkLNn0MApBDneSoA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=s1jfrrykcgbrBOlHQxjEEpcUCAManYhbSRLbDHXjq7xuswE+Mrf+dinTqoGPTY/Ap NigEePt91G4S5xTrlf41tw6UJePYXvWX4E3GK9FwTgERB2HSkf2GPIJw9z+CTwNxng zL19NNnSeqQQr4X3R7IHH4vTMb4OKTkiir/gKjWk= Message-ID: <3150c593-a3e2-4b4a-89e3-e69db038e397@arm.com> Date: Thu, 13 Aug 2026 13:38:33 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 1/2] gdb: Preserve IFUNC marker when finding inferior functions To: Andrew Burgess , gdb-patches@sourceware.org Cc: Simon Marchi , Wilco Dijkstra , Yury Khrustalev , Thiago Jung Bauermann , Adhemerval Zanella Netto , Carlos O'Donell References: <20260630110443.12900-1-muhammad.kamran@arm.com> <20260630110443.12900-2-muhammad.kamran@arm.com> <87a4qtllx9.fsf@redhat.com> Content-Language: en-GB From: Muhammad Kamran In-Reply-To: <87a4qtllx9.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 10/08/2026 22:12, Andrew Burgess wrote: > > I took a look through all the feedback you received on previous > versions, and I think everything raised has been addressed. If you're > happy to incorporate the two testsuite fixes I proposed above then I > think this patch is OK. > > Approved-By: Andrew Burgess > Thanks for the review and the approval. I’ve addressed your feedback in v5, which I’ve posted to the mailing list [1]. The updated series adds the gdb_load_shlib call, includes the minimal-symbol guard for the test’s malloc, and applies the style fixes you suggested for patch 2. I don’t have write access, so if everything looks OK now, could a maintainer please commit the series for me? Thanks, Kamran [1] https://inbox.sourceware.org/gdb-patches/20260811131219.510776-1-muhammad.kamran@arm.com/T/ > I'll take a look at patch 2/2 tomorrow, unless someone else beats me to > it. > > Thanks, > Andrew > > --- > > diff --git i/gdb/valops.c w/gdb/valops.c > index c478bdc3f15..f278d7b7cab 100644 > --- i/gdb/valops.c > +++ w/gdb/valops.c > @@ -113,52 +113,53 @@ struct value * > find_function_in_inferior (const char *name, struct objfile **objf_p) > { > struct block_symbol sym; > + bound_minimal_symbol msymbol; > > - sym = lookup_symbol (name, nullptr, SEARCH_TYPE_DOMAIN, nullptr); > + sym = lookup_symbol (name, nullptr, SEARCH_VFT, nullptr); > if (sym.symbol != NULL) > { > - if (objf_p) > - *objf_p = sym.symbol->objfile (); > + msymbol = find_gnu_ifunc (sym.symbol); > + if (msymbol.minsym == nullptr) > + { > + if (objf_p) > + *objf_p = sym.symbol->objfile (); > + return value_of_variable (sym.symbol, sym.block); > + } > + } > + else > + msymbol = lookup_minimal_symbol (current_program_space, name); > > - return value_of_variable (sym.symbol, sym.block); > + if (msymbol.minsym != NULL) > + { > + struct objfile *objfile = msymbol.objfile; > + struct gdbarch *gdbarch = objfile->arch (); > + > + struct type *type; > + CORE_ADDR maddr; > + type = lookup_pointer_type (builtin_type (gdbarch)->builtin_char); > + type = lookup_function_type (type); > + type = lookup_pointer_type (type); > + maddr = msymbol.value_address (); > + minimal_symbol_type minsym_type = msymbol.minsym->type (); > + > + if (minsym_type == mst_text_gnu_ifunc > + || minsym_type == mst_data_gnu_ifunc) > + type->target_type ()->set_is_gnu_ifunc (true); > + > + if (objf_p) > + *objf_p = objfile; > + > + return value_from_pointer (type, maddr); > } > else > { > - bound_minimal_symbol msymbol > - = lookup_minimal_symbol (current_program_space, name); > - > - if (msymbol.minsym != NULL) > - { > - struct objfile *objfile = msymbol.objfile; > - struct gdbarch *gdbarch = objfile->arch (); > - > - struct type *type; > - CORE_ADDR maddr; > - type = lookup_pointer_type (builtin_type (gdbarch)->builtin_char); > - type = lookup_function_type (type); > - type = lookup_pointer_type (type); > - maddr = msymbol.value_address (); > - minimal_symbol_type minsym_type = msymbol.minsym->type (); > - > - if (minsym_type == mst_text_gnu_ifunc > - || minsym_type == mst_data_gnu_ifunc) > - type->target_type ()->set_is_gnu_ifunc (true); > - > - if (objf_p) > - *objf_p = objfile; > - > - return value_from_pointer (type, maddr); > - } > + if (!target_has_execution ()) > + error (_("evaluation of this expression " > + "requires the target program to be active")); > else > - { > - if (!target_has_execution ()) > - error (_("evaluation of this expression " > - "requires the target program to be active")); > - else > - error (_("evaluation of this expression requires the " > - "program to have a function \"%s\"."), > - name); > - } > + error (_("evaluation of this expression requires the " > + "program to have a function \"%s\"."), > + name); > } > } > >