From patchwork Tue Jan 23 21:52:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thiago Jung Bauermann X-Patchwork-Id: 765202 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:10c4:b0:337:62d3:c6d5 with SMTP id b4csp1823653wrx; Tue, 23 Jan 2024 13:52:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IEK7O56rTWYpiin93wvMJHrq2ElpB+HnqKFvpfDNYHX7ONQFO9ba/Q2piE0iuoX3ApBMAGc X-Received: by 2002:a05:620a:bcb:b0:783:458e:2458 with SMTP id s11-20020a05620a0bcb00b00783458e2458mr9249439qki.113.1706046773967; Tue, 23 Jan 2024 13:52:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706046773; cv=pass; d=google.com; s=arc-20160816; b=LMhyLie1HXAGzfoLDZsDYNX7RMNmuqN2tpQd38d6/mBs1S46v6CTplDMlPIrvKwFNH dRZloVGvW7cJdWBzluwbcu/mR/k2VDN5nSh9SzAmzlwqmYir9bn4yDmwp5OEGZMJH8x+ IQ4xW/J6fDg6ICl9TNg1y4VxLRlJAHDgaf2O4QDCaYRZuhIbVNyVQPey/KYG/o+3TWJb JW4LWbIbPdzIJEGBSp0dgaJTZN09UYbP2/YK1hd9TZEuRoV207AHnwaR3Vjc5J/gDh0v 9p/N/w1uh92Qz5NK/wJm1nTxPsMY3iGvGzp4PBat2Ksmvbu86QIYJG0kjJdy828Lg3Er cgKQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=zfro8/eeXlX1W84Tb2pNnz6fD57jR1u2ArNnMS/Lo1g=; fh=72kqq0iQhigvR9Vv/oqX5ebs3Yyyw7XhzWxOOEPdupI=; b=qmWpEdaW6ZC3o7f4FQp8yErs5ZtInhDTJcEMvtKW+bIuG9qBGaKs/sjt2tecetTYe0 bJd7uYUsniXFZdx8RMzMlLDdfVJTJFfdYU1M5axTcGa6fpsrLdvGcEqEP0/rcTYA0zxd LCoZwU15Ai4qrbhIKkWBkxGuN0iSR1xX65DXDRGa81iuZilcrcT1KyistAtBPxqbAY8C +Ka0XyV4brMISQ/uMXPXKFMHHItwUCHiAMt+hvuHjwgD6ayihjD8QgQZvDvtmHxLg7QJ DJp6KrisJ6rwqzIzTjd2O+5T25oArZpS1U3Cd18BLItH98j4rMSns0inA96YHUOqqVPD m2ww== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PqbT5qhg; arc=pass (i=1); spf=pass (google.com: domain of gdb-patches-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gdb-patches-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id x3-20020ae9f803000000b00781cc3f5103si8344594qkh.511.2024.01.23.13.52.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 13:52:53 -0800 (PST) Received-SPF: pass (google.com: domain of gdb-patches-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PqbT5qhg; arc=pass (i=1); spf=pass (google.com: domain of gdb-patches-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gdb-patches-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9B4413858C41 for ; Tue, 23 Jan 2024 21:52:53 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by sourceware.org (Postfix) with ESMTPS id 32EDD3858D3C for ; Tue, 23 Jan 2024 21:52:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 32EDD3858D3C 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 32EDD3858D3C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::52a ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706046755; cv=none; b=aKZynAkJRdSQYTDFa2Bcm0hLuBspj2BW6nEiW9+IKZPYQJ6rZbgC9MTGmIFYVVGZjizAHbEfwx07TVE2CCvLBOhrHHxPgEdGysqEQjMZfoMvmsffbc4htAuJAw5YvpZWC7frS0Dwu2u8hJORjTFaE6dDfbO8cKKg9rMycuM9bPg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706046755; c=relaxed/simple; bh=WtFk9BaSBfNfOrBFqBGOZpvn3RfdzPBk5phUqIyo3Go=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=qhKqnSRtB0/zKCt8uUTX8+Cebn+gL55fyiKNiYoxgReFDkbccpnG+SW0MtrYlsp66qpVi++DmmUnVuT3bmXm5EasDoVfTSyWl3kemqWpQCI6YyhQSkSuuRuHywojOSGJpSZ80rvGOjgoKVzx28tOBMuLKNUMuyTWTUNASsnkpfY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-5ce9555d42eso4056430a12.2 for ; Tue, 23 Jan 2024 13:52:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706046752; x=1706651552; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=zfro8/eeXlX1W84Tb2pNnz6fD57jR1u2ArNnMS/Lo1g=; b=PqbT5qhgWaUc9nR5RE7CMlnLQQq+o3zUbhi02IJ1Gb9Q2jopLBU1PJuipsnwjtrNva Ten3A64HjsEi9F+VYXebaZmsv0KBoDzB1dZoo/A0VzB3YMJqV0HJjD1RcKYX5AduE9sL Lp8sSKp1pQD8oc2tAagI4u/tyZivv4zY6kzalSYK0fZm7mb2ZViXc5EEoSPaE99AteCX MG2H3mj65cKjnPo2ZxDofuXI/pCV3NSXoPlnZ0Xq4elt4mYzmwiji7XDO6wwKqUf4CyS GaJ4KMRISqfXMSv+5xaloC8Oi1E5ZYftpq92+DuO2yNQLuCjpNXLa4f7IxPhweMCTheo F/Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706046752; x=1706651552; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zfro8/eeXlX1W84Tb2pNnz6fD57jR1u2ArNnMS/Lo1g=; b=R1VnwfkX1gJOiGaFxZG0e8ot+rXckPGYSaUkNuFxtUBWGgYCeGUF5OIcP7x/IdjgFT dz787VIG/RdxKqTiK2dQJ9Fa2JVL4BPszc6OfMTJH6J6lXvxl/I09FxWpvvb5VVQFHUV lGBZXijXQU1oKx4dDuSimIFCHj1LzoxOTZp7UsdZb82SPg7Xwy+Uic7lEJgFEBI8XPKC Xy/pOH1xJeJaunDmpYhPdKUNO0CErUMlYPehd/ssvLGO1WN1MfMZ0aDzAM1lGpGpXDQd 6ygQa82UutH7aezvSDaQ5c6kki9OCjI6ai6W7jDld58muMHrl3OHX3KRVeRLtgik+Ozo UUiA== X-Gm-Message-State: AOJu0YzktRPkAqc/c3i9LahCJOU3V4HSJQNPJiOlGlF3C3y/f8dgn6lT DClSWXw3TM127L4lgJvbkv3wz5R++/5ayn8ryYZsVNcachrGfE/VAH0dOaPMfYIZZzujR4vCwA4 o X-Received: by 2002:a05:6a20:1e50:b0:199:7850:8d24 with SMTP id cy16-20020a056a201e5000b0019978508d24mr6601081pzb.124.1706046752104; Tue, 23 Jan 2024 13:52:32 -0800 (PST) Received: from localhost ([2804:14d:7e39:8470:49db:3a4b:45fd:57e1]) by smtp.gmail.com with ESMTPSA id o11-20020a65614b000000b005bd627c05c3sm9175341pgv.19.2024.01.23.13.52.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 13:52:31 -0800 (PST) From: Thiago Jung Bauermann To: gdb-patches@sourceware.org Subject: [PATCH] gdb/arm: Fix epilogue frame id Date: Tue, 23 Jan 2024 18:52:29 -0300 Message-ID: <20240123215229.2385404-1-thiago.bauermann@linaro.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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+patch=linaro.org@sourceware.org arm_epilogue_frame_this_id has a comment saying that it fall backs to using the current PC if the function start address can't be identified, but it actually uses only the PC to make the frame id. This patch makes the code match the comment. Another hint that it's what is intended is that arm_prologue_this_id, a function almost identical to it, does that. The problem was found by code inspection. It fixes the following testsuite failures: FAIL: gdb.base/unwind-on-each-insn.exp: foo: instruction 9: check frame-id matches FAIL: gdb.reverse/solib-reverse.exp: reverse-next third shr1 FAIL: gdb.reverse/solib-reverse.exp: reverse-next second shr1 FAIL: gdb.reverse/solib-reverse.exp: reverse-next first shr1 FAIL: gdb.reverse/solib-reverse.exp: reverse-next generic FAIL: gdb.reverse/solib-reverse.exp: reverse-step into solib function one FAIL: gdb.reverse/solib-reverse.exp: reverse-step within solib function one FAIL: gdb.reverse/solib-reverse.exp: reverse-step into solib function two FAIL: gdb.reverse/solib-reverse.exp: reverse-step within solib function two Tested on arm-linux-gnueabi-hf. --- gdb/arm-tdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index f1aa730579bc..0d0431e0d1cd 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -3252,7 +3252,7 @@ arm_epilogue_frame_this_id (frame_info_ptr this_frame, arm_gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (this_frame)); - *this_id = frame_id_build (arm_cache_get_prev_sp_value (cache, tdep), pc); + *this_id = frame_id_build (arm_cache_get_prev_sp_value (cache, tdep), func); } /* Implementation of function hook 'prev_register' in