From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id f8YIAFwaZGZ0SysAWB0awg (envelope-from ) for ; Sat, 08 Jun 2024 04:46:20 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=jetbrains.com header.i=@jetbrains.com header.a=rsa-sha256 header.s=googleapps header.b=Mow4sbqp; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id C5BA01E0C1; Sat, 8 Jun 2024 04:46:19 -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 963C11E030 for ; Sat, 8 Jun 2024 04:46:17 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D4A5F3858D39 for ; Sat, 8 Jun 2024 08:46:16 +0000 (GMT) Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by sourceware.org (Postfix) with ESMTPS id 5587D3858D28 for ; Sat, 8 Jun 2024 08:45:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5587D3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=jetbrains.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=jetbrains.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5587D3858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::631 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717836354; cv=none; b=VxLEcLWITeb/HX4Or9mnKCfrF+8aprMT4+5qvEsgrx5aagpYFI1SRD6JwzUqF0Ac+dw3kuJ3UKe+cT/iNg2ByMs/gUc5QIghe/2bh8q95E53dkh+PyklWtB5t/tXY0eC836gcXNo1YFckv9wZEOPy+A38jcTjjDwFjSFIzeDIRc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717836354; c=relaxed/simple; bh=M2EyiDjmth4u9B0fquyjuKP3U9yZ2RaFWlPuernqGkw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=B5ar1vJkkJq8UlWbPcIZRUT1ZbZc6+m2LYBIsdnLVXrXkGdIrCZ7eIIa1yXPBTRSoMJglV3muestUGkPlnfBMfU6fiReGlCnzmVJYfDQOf5FDYLvZCN8YfACwDdFP5XJ+Weio9mKP/UqqGvZ/ETJ3JVCoDeJIW0U1PYGVxU9D1I= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-a6f06699ae4so10906566b.0 for ; Sat, 08 Jun 2024 01:45:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jetbrains.com; s=googleapps; t=1717836350; x=1718441150; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=buYs4wQ7x4xSjgxRaYuu9i8Yz6c+ptPEfFlVXDXNvJ8=; b=Mow4sbqp1rNbkHjcEAhW9EDcf/g9S344pN4/ks0KCY5J35Gf/C1UztG47FVaO/V9hB sJzas3XvU/Wioa49a3K9EKNT14G13Ey76KIhrj7/Iue+AaRRwwRL1aEUraErrswh98nN BGV2JOgt5GxdQt3Xrwp3yr8ycI3r4xjJhal/k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717836350; x=1718441150; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=buYs4wQ7x4xSjgxRaYuu9i8Yz6c+ptPEfFlVXDXNvJ8=; b=ijYjtERox8GNV50U3CC9ewMpqvhfuG+7u22Bz6gE+bkFobkyWwAFSTu1DcvongqyHT cEXGXIzWYx23f7b5F7H3NdDMIR6HxNuMMRn0AFzddYHuK9iE5tdO55YlmdNywg20UvL+ PLZFbD2njc64w+tcmKDotd3a7mGvkNp93RTBaPjuz//fNfOBSjm68fZXcGBhWdPCdyda 8DBc+hcQtJRGwIdkkhi0AyVET90pyGJ2Goy6ePXCaLiVtVxHPukfuoBIqQERaw68xZob HmR5ZwJO5PO55GQOiwiexhl+pKdLEbJOpXCON8eF/hEW5Y7uF35QslrpR/nqmzr9zfTU L+Xw== X-Gm-Message-State: AOJu0YxM/xFnscvVgVkUQLF3pvbSeVXEGnDFiJBg7RZch+ZMyvgvJNAR 3cnagpHS/bOS+gug0p3x427Dmgz7QeBIFhauxwme1q+uWTOFfoGPMTIlWObiK9LqOxsshKFKVn0 = X-Google-Smtp-Source: AGHT+IEdRzpn+SKr0d0vdxGvfTGlMExKUBmtNR4GZDVJmeefWiRkQoNxBNYxEF54qBu9aT3ozZIcsw== X-Received: by 2002:a50:a405:0:b0:57a:2763:c29b with SMTP id 4fb4d7f45d1cf-57c509cef4cmr2671390a12.41.1717836350370; Sat, 08 Jun 2024 01:45:50 -0700 (PDT) Received: from lubuntu2.labs.intellij.net (ad96e1c12.dsl.de.colt.net. [217.110.28.18]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57aae234204sm3937078a12.87.2024.06.08.01.45.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Jun 2024 01:45:50 -0700 (PDT) From: Dmitry Neverov To: gdb-patches@sourceware.org Cc: dmitry.neverov@jetbrains.com Subject: [PR 31727] Recognize -2 as a tombstone value in .debug_line Date: Sat, 8 Jun 2024 10:45:29 +0200 Message-ID: <20240608084529.1406412-1-dmitry.neverov@jetbrains.com> X-Mailer: git-send-email 2.45.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.6 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+public-inbox=simark.ca@sourceware.org Commit a8caed5d7faa639a1e6769eba551d15d8ddd9510 handled the tombstone value -1 used by lld (https://reviews.llvm.org/D81784). The referenced lld commit also uses the tombstone value -2 for pre-DWARF-v5 (https://github.com/llvm/llvm-project/commit/e618ccbf431f6730edb6d1467a127c3a52fd57f7). If not handled, -2 breaks the pc step range calculation and triggers the assertion: gdb/infrun.c:2794: internal-error: resume_1: Assertion `pc_in_thread_step_range (pc, tp)' failed. This commit adds -2 tombstone value and handles it in the same way as -1. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31727 --- gdb/dwarf2/read.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 6a19064409c..d720f58c8b4 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -17897,8 +17897,8 @@ class lnp_state_machine we're processing the end of a sequence. */ void record_line (bool end_sequence); - /* Check ADDRESS is -1, or zero and less than UNRELOCATED_LOWPC, and if true - nop-out rest of the lines in this sequence. */ + /* Check ADDRESS is -1, -2, or zero and less than UNRELOCATED_LOWPC, and if + true nop-out rest of the lines in this sequence. */ void check_line_address (struct dwarf2_cu *cu, const gdb_byte *line_ptr, unrelocated_addr unrelocated_lowpc, @@ -18308,13 +18308,16 @@ lnp_state_machine::check_line_address (struct dwarf2_cu *cu, unrelocated_addr unrelocated_lowpc, unrelocated_addr address) { - /* Linkers resolve a symbolic relocation referencing a GC'd function to 0 or - -1. If ADDRESS is 0, ignoring the opcode will err if the text section is + /* Linkers resolve a symbolic relocation referencing a GC'd function to 0, + -1 or -2 (-2 is used by certain lld versions, see + https://github.com/llvm/llvm-project/commit/e618ccbf431f6730edb6d1467a127c3a52fd57f7). + If ADDRESS is 0, ignoring the opcode will err if the text section is located at 0x0. In this case, additionally check that if ADDRESS < UNRELOCATED_LOWPC. */ if ((address == (unrelocated_addr) 0 && address < unrelocated_lowpc) - || address == (unrelocated_addr) -1) + || address == (unrelocated_addr) -1 + || address == (unrelocated_addr) -2) { /* This line table is for a function which has been GCd by the linker. Ignore it. PR gdb/12528 */ -- 2.45.1