From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id GqRwG2GPYGqvkyQAWB0awg (envelope-from ) for ; Wed, 22 Jul 2026 05:37:37 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=j0S4qWYO; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 5DF3C1E099; Wed, 22 Jul 2026 05:37:37 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham 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 346CB1E099 for ; Wed, 22 Jul 2026 05:37:35 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B4D5E4BA2E3D for ; Wed, 22 Jul 2026 09:37:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B4D5E4BA2E3D Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=j0S4qWYO Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) by sourceware.org (Postfix) with ESMTPS id D55B84BA2E13 for ; Wed, 22 Jul 2026 09:37:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D55B84BA2E13 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D55B84BA2E13 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=198.175.65.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784713028; cv=none; b=GAScnQ8XhoRQe7+tV4y8wIkmHZCKD6L5bUvcvISAZpBkfkXNJTDBXEe8sG/XS3BUdGmE/6T7se+lWEuqv3WaqDxnZfwy5XbqCe+t1M0bH7AfIhhe321s44jvRVpaLfLhnhLTT2sb5Iv5wK+D7oTD9JjMv9ZjePjHaN2MxDiJb3o= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784713028; c=relaxed/simple; bh=Na5QFkcMtOsdIW7svEbv82Z7YAc3Ok1d5yl0MiBWQws=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=h8Bd5KYa3+qrz9ODS1XqhdvyEPeGyeNQVT/Flml84gc/ggBSDgw6kL1m+zIQHDQJDWGPESgzvAu/DpJL4NmlZ542San0SQivELNibq8roCC0RX4NJrtsfh4ierTqJ3lIokbZVl0sY7UV6jNqjJsvqk2MUvgoI5JeXTJ0R4cOEMs= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=j0S4qWYO DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D55B84BA2E13 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1784713028; x=1816249028; h=from:to:subject:date:message-id:mime-version: content-transfer-encoding; bh=Na5QFkcMtOsdIW7svEbv82Z7YAc3Ok1d5yl0MiBWQws=; b=j0S4qWYOXiOauoGNwm182/V5qbfeuEit/5sS4fu2RDLuuIBBIFqvNdnx PxVUXt/u80GCV009GCaz+TzCSWJXJcSus76vzQYUk6cp8E+TQD5dx0voO WEGq4HwJmuhBajdvuNm45JV57o/tniqgf3/dWer/2u8K/qj/BMK6sKd1R hp3V6qYxTCQD0fqc8BelmA08Rod1Hiu3MxxB6n5aq8ewwEEIczpK2kpVa BobUIR0hqgjpq0+dNCMdSxCea+R+r7nILCBcJkv7KTs0nGWn6FAElIo8U ptoekoPEkCTHPR0JS0FATA4lXniXHc0u0wbhRoXrRWI+buAqxcBYVcfkj w==; X-CSE-ConnectionGUID: 3/QMLeAHQTiq4mEJgdGdTw== X-CSE-MsgGUID: pZrFlN3hSLaOhZUvxGvp3g== X-IronPort-AV: E=McAfee;i="6800,10657,11853"; a="95705666" X-IronPort-AV: E=Sophos;i="6.25,178,1779174000"; d="scan'208";a="95705666" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2026 02:37:07 -0700 X-CSE-ConnectionGUID: z/NROccOSay+ulpRWCtVDQ== X-CSE-MsgGUID: EI7uYPquQv+Z+VG/IjG4mQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,178,1779174000"; d="scan'208";a="261600603" Received: from dut1629dg2frd.igk.intel.com (HELO localhost) ([10.211.178.246]) by ORVIESA003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2026 02:37:06 -0700 From: Klaus Gerlicher To: gdb-patches@sourceware.org, christina.joos@intel.com Subject: [PATCH v3 0/1] Fix block filter heuristic in linespec to preserve distinct code paths Date: Wed, 22 Jul 2026 09:36:53 +0000 Message-Id: <20260722093654.30044-1-klaus.gerlicher@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 From: "Gerlicher, Klaus" Hi all, hi Christina, this is V3 of the relax block filter patch. V2 is here: https://inbox.sourceware.org/gdb-patches/20260604132938.416526-1-klaus.gerlicher@intel.com/ aarch64 support: V3 adds full support for aarch64: aarch64_insn_is_jump, aarch64_insn_is_ret aarch64_insn_branch_target. Tested on aarch64 (raspi5). The NEWS entry is updated accordingly to mention x86 and aarch64 as supported platforms. I hope this shows that this is a general solution and not just a x86_64 hack. Add predicate functions for insn_is_ret, insn_is_jump, and insn_branch_target: extended_block_filter_supported helper in linespec.c uses all three predicates to determine whether the heuristic is effective on the current architecture. NOTE: "show linespec-extended-block-filter" reports architecture support using the predicates, so testing can use this to report unsupported. Exception safety: V3 wraps the process loop body in a try/catch that returns false on any memory read failure. Removed early break from de-duplication loop: V1/V2 kept the original break after filter[j] = 0, so the inner scan stopped at the first same-block SAL j regardless of whether the new heuristic had already preserved an earlier via continue, V3 removes the break and adds a filter[i] guard on the outer loop, ensuring every same-block pair is evaluated. Test updates: Adds a block_filter_arch_supported helper proc that queries the new show output, and uses unsupported instead of fail on architectures that do not implement the required gdbarch methods. I did not find any documentation on the original heuristic in GDB.texinfo and so I also did not try to add anything there. I'm also not sure where we would put such description. If anyone could point me where to put it, I would love to add some documentation there since things are getting more complicated now. Thanks, Klaus Gerlicher, Klaus (1): gdb/linespec: relax block filter to preserve distinct code paths gdb/NEWS | 11 + gdb/aarch64-tdep.c | 91 ++++++ gdb/amd64-tdep.c | 57 ++++ gdb/arch-utils.c | 10 + gdb/arch-utils.h | 1 + gdb/arch/aarch64-insn.c | 23 ++ gdb/arch/aarch64-insn.h | 2 + gdb/gdbarch-gen.c | 59 +++- gdb/gdbarch-gen.h | 16 + gdb/gdbarch_components.py | 18 ++ gdb/linespec.c | 148 ++++++++- .../gdb.linespec/block-filter-cases.c | 126 ++++++++ .../gdb.linespec/block-filter-cases.exp | 291 ++++++++++++++++++ 13 files changed, 848 insertions(+), 5 deletions(-) create mode 100644 gdb/testsuite/gdb.linespec/block-filter-cases.c create mode 100644 gdb/testsuite/gdb.linespec/block-filter-cases.exp -- 2.34.1 Intel Deutschland GmbH Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany Tel: +49 89 991 430, www.intel.de Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell Chairperson of the Supervisory Board: Nicole Lau Registered Seat: Munich Commercial Register: Amtsgericht Muenchen HRB 186928