From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id lTIADp4Ig2Z4UBcAWB0awg (envelope-from ) for ; Mon, 01 Jul 2024 15:50:54 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=nBqu60ku; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 2677A1E0C3; Mon, 1 Jul 2024 15:50:54 -0400 (EDT) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 E2EC61E030 for ; Mon, 1 Jul 2024 15:50:51 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E7377385C6C1 for ; Mon, 1 Jul 2024 19:50:50 +0000 (GMT) Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by sourceware.org (Postfix) with ESMTPS id 0E92738114E0 for ; Mon, 1 Jul 2024 19:50:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0E92738114E0 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0E92738114E0 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719863429; cv=none; b=X23R9gtKekMgB9KeodombUlNGvy3ssQZ0yNInBcfnTi6HCsI/1mQB/xA5wxMbCEOWhOWwXZAy0xh/PJbBFzqoeElg2loJDC3UpRESa6dLXYVkEqw5BsrPD6VxCM/tc3tWYKb5vtB6P52QgK9qDnbFqPpf9/Kwaa8PsnUcgcsBsQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719863429; c=relaxed/simple; bh=ngWDvpJSxhlTfOwsDEUUeO+xKSpCbyEd0Z2M8lZSL1Y=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=P/YAYsh0j6DhwdRTHM+UKBvguwyQjIN5FpiJkcjzIHarZyj/D/cTG91P5r3t3BUdludvzOo5Lrk+jzBO3qdjpAuCzetb9zHjh2eMyXw46B26XV7nvluJHrEs/nP0uq35NAF/QCViRDzN1FoCFPDyvxy3V7GYKOF8qVwKKU0PWmU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1fa9ecfb321so20147925ad.0 for ; Mon, 01 Jul 2024 12:50:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719863426; x=1720468226; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ld4R+hf1H25aIINXJD4P+Cc25V1bHoAXP4OslZSq0fs=; b=nBqu60kugNlO/o3jTJzQLYBTFzHA7KyPPO3zqeNkWicEQcwc+anbgM5eOhHM8b3YlF dnKJzu8Kz0sOw5vHItFbhDHJI5LTuyspVz8gmr2q10nkPOzhZktZ8xoh25P0zFJFxQoW LsoKhn8nlvKV5yGqYjEwQpK/v0EbZHpPNn5CWZJiy1NxgalFINF/QfAj5T2kkI6QEXu9 2+Pde9RylrwuBqh+0LFyIPHWL34wFUJWXPEFgQT5vCGQax6O3LawqKJl5NexsWsAKGDa dwrqzCJ9obua2ySxkjqK+ioFHvSGvrNVKcRfEEovQG9h5bo8z9FzeOBnrvbU3ucdHprw ZdNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719863426; x=1720468226; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ld4R+hf1H25aIINXJD4P+Cc25V1bHoAXP4OslZSq0fs=; b=XFOLonVIXT7jWK4ILPY8XGuPqyAxsNuuC28OkOzvJf/oTT2cjUFNAjhQno13D6bHRU A2o9eEZg5M7qXYYs6MIOyvcHPAAwN0wrKTw3WBuS4U1NwII9pFlJvF/LtJu3ppK0sdbS RT3Ai6JuoWnym3UzAWZnrGfPJVJocaxUmbE4AzEsMVrlYD6hcxLCtHhHl20xusUPRk9L L/GVd/3USe/Psk4yNNvlh4bOE44ducPdEGF7T5xNjItf5nJ4RQ7GZJl8+AQIladHJoc9 huNmZd1DDdJr4fZUVWubH9qcNfQRINVEWc2CkXF/44N6SDzD1xZt47ZFlhJEX0DvYhMf xArg== X-Gm-Message-State: AOJu0YwN5prAicyah3vXnrradqbplZy4gxhC/Ko6YJ6zhY8kxvJllAk8 zRR437tD8oRV1kmU+FlYHBKfd1dkFUn2XdgAOzBbZjedv4pNaHOWuZz4qg== X-Google-Smtp-Source: AGHT+IEh13Xc8GSQX2Mm5AVEMc3FSLsjAaCo2sBnHWDMhb7W08Fu8dUaz6GwO5f4gisVt2CQ0KOGaQ== X-Received: by 2002:a17:90a:6fc1:b0:2c8:8df1:118f with SMTP id 98e67ed59e1d1-2c93d75a4a8mr3462906a91.33.1719863425778; Mon, 01 Jul 2024 12:50:25 -0700 (PDT) Received: from valdaarhun.localnet ([223.233.84.154]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c91d3e7e4bsm7158571a91.52.2024.07.01.12.50.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 12:50:25 -0700 (PDT) From: Sahil To: gdb-patches@sourceware.org Cc: Sahil Siddiq Subject: Re: [PATCH] gdb: fix "frame function" issue when call is last instruction Date: Tue, 02 Jul 2024 01:20:22 +0530 Message-ID: <6070620.lOV4Wx5bFT@valdaarhun> In-Reply-To: <20240630140808.919614-1-sahilcdq@proton.me> References: <20240630140808.919614-1-sahilcdq@proton.me> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no 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~public-inbox=simark.ca@sourceware.org Hi, On Sunday, June 30, 2024 7:38:08=E2=80=AFPM GMT+5:30 Sahil Siddiq wrote: > Currently, the "frame function" fails when the last > instruction is a call. In such a case, the $rip > register points to an address that lies outside the > frame. >=20 > Using "get_frame_address_in_block" instead of > "get_frame_pc" resolves this issue. >=20 > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30929 > --- > Hi, >=20 > This is my first time contributing to gdb. I have > tried to adhere to the styling convention. Please > let me know if I have missed something. >=20 > Instead of extending the existing frame-selection.exp > test, I thought I would create a new test since the C > file is new and it seemed like the implementation of > the test isn't similar enough to be kept in the existing > exp file. Please let me know if this is undesirable. >=20 > Thanks, > Sahil >=20 > gdb/stack.c | 4 +- > .../frame-selection-last-instr-call.c | 28 ++++ > .../frame-selection-last-instr-call.exp | 139 ++++++++++++++++++ > 3 files changed, 169 insertions(+), 2 deletions(-) > create mode 100644 gdb/testsuite/gdb.base/frame-selection-last-instr-cal= l.c > create mode 100644 > gdb/testsuite/gdb.base/frame-selection-last-instr-call.exp > [...] I noticed that the test introduced in this patch fails in some environments= =2E See for example: 1. regressions on arm [1] 2. regressions on aarch64 [2] I have submitted a new patch where the test should run successfully regardl= ess of the build environment. Thanks, Sahil [1] https://ci.linaro.org/job/tcwg_gdb_check--master-arm-precommit/2800/ [2] https://ci.linaro.org/job/tcwg_gdb_check--master-aarch64-precommit/2814/ =20