From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 175kDlyjAmpNLTIAWB0awg (envelope-from ) for ; Mon, 11 May 2026 23:49:48 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=t03CnxJL; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 1BCD81E093; Mon, 11 May 2026 23:49:48 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 154301E093 for ; Mon, 11 May 2026 23:49:47 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 07DB54BBC099 for ; Tue, 12 May 2026 03:49:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 07DB54BBC099 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=t03CnxJL Received: from mail-dl1-x122c.google.com (mail-dl1-x122c.google.com [IPv6:2607:f8b0:4864:20::122c]) by sourceware.org (Postfix) with ESMTPS id F2C634B920A4 for ; Tue, 12 May 2026 03:49:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F2C634B920A4 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F2C634B920A4 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::122c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1778557751; cv=none; b=lozK2iOYbN9VzG0EaKeWh3+0v9iaSi4PfYMG2u2hSk9/s881ON7uq1ziCxysC5cDI73ydM/Ksmuipge+5nic5xjJmUVB6bfT4r4699H2idib8JCsdh4vcLDlXgdbilYhhavNqrzk50dOHDPGvpmOONZmKyq5gPJ7BDcVUofFbvU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1778557751; c=relaxed/simple; bh=7PrvgOxUKuBnNKeKKu7UJhBaFX1EChpVihLdpz6ERrE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=FCl1WxzDQpztO51vLo5tgJd7e9qg6d6KMRwRpWPprBNFcxO57AdK4xVB0ANc1qoaZHEuS9mZgm3ychpyBlfAtavW3i6ZpU8Bp+gREuc6d8VtOVAZG4jRDHB0Ieij65MmSXzkm6pTZT8UeykEShfUPZlzWO535KX2beu/mlRTHCI= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=t03CnxJL DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F2C634B920A4 Received: by mail-dl1-x122c.google.com with SMTP id a92af1059eb24-13246950f3cso6313968c88.1 for ; Mon, 11 May 2026 20:49:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778557750; x=1779162550; darn=sourceware.org; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=xQ5fAE/hDBXN+grxVbJ78oISd/kiuhd9QwQ7Spo/jzg=; b=t03CnxJLio16vsYauUxwLgJf32elqZpNUPKdQqsFgo58EJ76Q29lwXR/F7ceMiGyTL PRmSKRZhl3Te4zypEipDGLpPKAvovRXA15604KNGw+wuk2ihMPZjHF9ohxE2VEjXSiv8 gtfZl3l5fN6y+zhZdo54FR+NcHdnhbThd1tH8C8Du2uYehWIF7+T2NCQcM809x83HEfC Vsvsj3NsK/AKMWHdl8HGHAMsESFEyi/Xq0HNt/nLRFcPrI5h6vwIyII6mNnGuUCNo2Ym FIwdR7GxLDAxQpIbzKNEne36aI8U7n8aGmRnsvwmrEQz80dnn18Dv5L6joQHKkB9fSVK eBtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778557750; x=1779162550; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=xQ5fAE/hDBXN+grxVbJ78oISd/kiuhd9QwQ7Spo/jzg=; b=NQqqk9K7gcrKdwRaaRbeQUPItKJr1Oxyu71tXiJuvucrdDvyAzhEQIQW5FFmo0RMDi wiJN2mqDKp/X9WukYBRmLvUjca+s4eK7chveST+mFi2F6xhGvHFb20LXjSfZhwObXAmL kgbt17yTbsq+lDK/02uKVKewQKsc9eVEOOPLpDTHEoySwqD2g59d31N5Guyc+LuIdrvl z0860SXj4iTh0q6JkU9E8FjRdH+DuV40yXXutD7/+tAVQjrwi4rpEIXryaif0Q6reIAU KwJwheNlgzsYUnvuGOeZ3qYC0IiPkYNMBKNiDrX0Q0FxyxxUsTejJHtP0ZkKSuKABe3R vjrA== X-Gm-Message-State: AOJu0Yx0fwpYSa5jgEioWv9P2gLLukxKApMU+418M6lXiTERDgOp8zYK OrR8JCsnmW+w8S/C8mvD+OF9Nl917JG+gGvjIZWVwQZXL6etxl2+9f5TSAWAbxUVxwGcC5MlNnF c/6jH X-Gm-Gg: Acq92OGSj2OqgpYToxbUmInIVqJ3u5XUb73pRbcJU/6M0KQ4A/DMC/7awRUMoh0LbFW uFpeIhiOjIb/IrKxXbVS8GWaHmKtczqsN4Z0Q43uz5/jai2zMJeV3tknoNBqmC/U5hPjIsuo6bs m/IwqVQXLokNqdiEKuqglZkEwfkCnY3lEdQQQDI7rhPZ7cKQXjb5e+VWW3aTMwzSe+Mi+gRsi2Q nq+J0PdOhsORm7h+2a5amkzeQX2YKKUFqrX/1IVmNXPyPiMOS50yGQ1Csr43kGmwn6J68YzwNaj a34kM3jhGwq+ryJkgCHBWBr+8mcLBC17tStLy0BzBrJ0YpHvIULMmxg4nqwAYfQIv91JzdvFnj2 6Wd9wQohLcBD1D01Aj+UflmCXA7GjQQL3l6pVpI3OU163MSujpLxJiDX277r/0Tk6pqkVQHd9KP sybvBvqexkieVX8ByU8aZ/n/b5NIxezrShsg== X-Received: by 2002:a05:7022:322:b0:128:d5f1:d594 with SMTP id a92af1059eb24-132a79ee784mr6319208c88.10.1778557749654; Mon, 11 May 2026 20:49:09 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8083:c4f1:ef88:5168:2d26]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1327875a269sm17284686c88.13.2026.05.11.20.49.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 20:49:09 -0700 (PDT) From: Thiago Jung Bauermann To: Christina Schimpe Cc: gdb-patches@sourceware.org Subject: Re: [PATCH v2 7/9] gdb: Provide gdbarch hook to distinguish shadow stack backtrace elements. In-Reply-To: <20260123080532.878738-8-christina.schimpe@intel.com> (Christina Schimpe's message of "Fri, 23 Jan 2026 08:05:29 +0000") References: <20260123080532.878738-1-christina.schimpe@intel.com> <20260123080532.878738-8-christina.schimpe@intel.com> User-Agent: mu4e 1.14.1; emacs 30.2 Date: Tue, 12 May 2026 00:49:07 -0300 Message-ID: <87tssdz3rg.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain 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 Christina Schimpe writes: > index 1f24a3a6d72..d39cba6e016 100644 > --- a/gdb/gdbarch_components.py > +++ b/gdb/gdbarch_components.py > @@ -2911,3 +2911,24 @@ In case shadow stack is not enabled for the current thread, return -1. > ], > predicate=True, > ) > + > +Method( > + comment=""" > +There can be elements on the shadow stack which are not return addresses. > +This happens for example on x86 with CET in case of signals. > +If an architecture implements the command options 'backtrace -shadow' and > +the shadow stack can contain elements which are not return addresses, this > +function has to be provided. > + > +Return true, if FRAME does not contain a return address in FRAME->VALUE > +but another valid value for the architecture's shadow stack. In this case, > +also the string frame_type has to be configured to display the type in the > +shadow stack backtrace. > +""", > + type="bool", > + name="is_no_return_shadow_stack_address", > + params=[ > + ("const shadow_stack_frame_info &", "frame"), > + ("std::string &", "frame_type")], > + predicate=True, > +) Small nit: here the Black code formatter also makes a change: name="is_no_return_shadow_stack_address", params=[ ("const shadow_stack_frame_info &", "frame"), - ("std::string &", "frame_type")], + ("std::string &", "frame_type"), + ], predicate=True, ) I also like Tom's idea of using a std::optional for frame_type, but regardless of whether you decide to adopt it: Reviewed-by: Thiago Jung Bauermann -- Thiago