From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <3uMn7XgcKCzkhVnfmVtbjjbgZ.XjhbYW-kVoXcZnnjpmXZrVmZ.jmb@flex--maskray.bounces.google.com> Received: from mail-pg1-x549.google.com (mail-pg1-x549.google.com [IPv6:2607:f8b0:4864:20::549]) by sourceware.org (Postfix) with ESMTPS id 675733858D37 for ; Tue, 30 Jun 2020 23:24:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 675733858D37 Received: by mail-pg1-x549.google.com with SMTP id n32so16296099pgb.22 for ; Tue, 30 Jun 2020 16:24:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=tsvByUR39cfi4+UWS82/+pq3v3h0qkLXUVlGF0GysN4=; b=YtBo4FfJYPxydpsVdVXhn5eRe4fgBuD1Eg+kBTPo7WOoHro72HUOQQCVXHLtB3f8SH 8oASNLZ21A4Vw9+ob7LDsQU2vabZqLxhXzIXFdDnEkxT4I6qOY/jJk2BEjcvrNLJZ0Ma y0BAvJalE98xlEIQQ5k4/cfPzrSE9pVz2vtn3rI445atlGRFuKKFkhlOAVpTpekRRrwf E7ht2rKIi6eziYeQS7Bt42P4kISs5siW2ZIip52PjxbTcIVkfMcpOa5AGSM6y73aPdRH z+C59q3ddSAPkH7ptr5Eb4SLdQP9+bhwyCbRZOFbubu5TMO73QkV+PpI4dtKRWRNis2Z JMdQ== X-Gm-Message-State: AOAM530g2yMy//+vfAqedJgTlP9bV9MncbhDZEzErl8u2L1hig3I5fJd 05Dgl31F4Y6r6lK4f/nf+y1DfclthzGqMIJ0qCq31nXD7ww7b1DToFLlxeFVBkbSQAPNuiPMnpW 8yQxBzINoSGP4svQheSR6BA9oAD1Xc7j+OwuN6P7Uo/p2XGRZwS7vUMhkRLSzIwIbH+Tryw== X-Google-Smtp-Source: ABdhPJxgG4tydKwtHK+ouNAM9K8uTzFAzeCsLIYsdYDerqEX4WCcrGVn6bRadhjhL6s85lrc8Jr6BHsXjFLx X-Received: by 2002:a17:90a:f198:: with SMTP id bv24mr25513414pjb.206.1593559480209; Tue, 30 Jun 2020 16:24:40 -0700 (PDT) Date: Tue, 30 Jun 2020 16:18:42 -0700 Message-Id: <20200630231842.508205-1-maskray@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.27.0.212.ge8ba1cc988-goog Subject: [PATCH] gdb: Recognize -1 as a tombstone value in .debug_line From: Fangrui Song To: gdb-patches@sourceware.org Cc: Fangrui Song Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-19.2 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Tue, 30 Jun 2020 23:24:44 -0000 LLD from 11 onwards (https://reviews.llvm.org/D81784) uses -1 to represent a relocation in .debug_line referencing a discarded symbol. Recognize -1 to fix gdb.base/break-on-linker-gcd-function.exp when the linker is a newer LLD. gdb/ChangeLog: * dwarf2/read.c (lnp_state_machine::check_line_address): Test -1. --- gdb/dwarf2/read.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index b097f624b6..7cf2691ae9 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -20380,9 +20380,13 @@ lnp_state_machine::check_line_address (struct dwarf2_cu *cu, /* If ADDRESS < UNRELOCATED_LOWPC then it's not a usable value, it's outside the pc range of the CU. However, we restrict the test to only ADDRESS values of zero to preserve GDB's previous behaviour which is to handle - the specific case of a function being GC'd by the linker. */ + the specific case of a function being GC'd by the linker. - if (address == 0 && address < unrelocated_lowpc) + LLD from 11 onwards (https://reviews.llvm.org/D81784) uses -1 to represent + the tombstone value. + */ + + if ((address == 0 && address < unrelocated_lowpc) || address == (CORE_ADDR)-1) { /* This line table is for a function which has been GCd by the linker. Ignore it. PR gdb/12528 */ -- 2.27.0.212.ge8ba1cc988-goog