From patchwork Wed Mar 8 13:26:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Puputti X-Patchwork-Id: 55562 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AB91C3850869 for ; Wed, 8 Mar 2023 13:26:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AB91C3850869 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1678282015; bh=4drtQQQXxfcAk9VRBxlgWhDmUIoqtLVUf3WNMuaSXzs=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=p4DkwFYMLvzEFEFVvPOGHUFmeKY5ClAyK0OOQeZp0dfn9LETsHwOBU4pZQ+9Yv+NE 6Dth9Fb+I4XnuTtMv4Vdt3+NP91BYoRuF8y7fPJdHRQE0/LMjNZlbc6PeymgEe/pHr xZfvagdUVp5iBTqasTQXdVKOVfYMbrw7POtAGYVA= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by sourceware.org (Postfix) with ESMTPS id C14363858289 for ; Wed, 8 Mar 2023 13:26:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C14363858289 X-IronPort-AV: E=McAfee;i="6500,9779,10642"; a="334862066" X-IronPort-AV: E=Sophos;i="5.98,243,1673942400"; d="scan'208";a="334862066" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2023 05:26:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10642"; a="676969541" X-IronPort-AV: E=Sophos;i="5.98,243,1673942400"; d="scan'208";a="676969541" Received: from ull-mpuputti-02.iul.intel.com (HELO localhost) ([172.28.49.83]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2023 05:26:23 -0800 To: gdb-patches@sourceware.org Subject: [PATCH 0/1] gdb, infcmd: Support jump command with same line in multiple object files. Date: Wed, 8 Mar 2023 14:26:06 +0100 Message-Id: <20230308132607.1674441-1-matti.puputti@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_NONE, TXREP 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.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Matti Puputti via Gdb-patches From: Matti Puputti Reply-To: Matti Puputti Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" Fixes the issue where jump fails if the jump target is in multiple object files. For example, a header file defining a static function is included in multiple source files, each calling the function. When debugger is aksed to jump a line inside that function, there would be multiple locations matching the target. Solution in this commit is to select the location in the current object file. Matti Puputti (1): gdb, infcmd: Support jump command with same line in multiple object files. gdb/infcmd.c | 14 ++++++- gdb/testsuite/gdb.base/jump2.c | 29 +++++++++++++++ gdb/testsuite/gdb.base/jump2.exp | 59 ++++++++++++++++++++++++++++++ gdb/testsuite/gdb.base/jump2.h | 30 +++++++++++++++ gdb/testsuite/gdb.base/jump2_foo.c | 24 ++++++++++++ 5 files changed, 155 insertions(+), 1 deletion(-) create mode 100755 gdb/testsuite/gdb.base/jump2.c create mode 100755 gdb/testsuite/gdb.base/jump2.exp create mode 100755 gdb/testsuite/gdb.base/jump2.h create mode 100755 gdb/testsuite/gdb.base/jump2_foo.c