From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 68F1A3858017 for ; Fri, 11 Nov 2022 16:36:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 68F1A3858017 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668184604; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AJiBi3KVh4t5LkwYToZWuJjU26pF8WCSmWElXgF1rQw=; b=QX/I5JGhvsOB1zMB9wdFBCTm9BB+YE5ebR7F5+Z8o5TQwETiRzPajZoV1qyMKxLTU85xkJ Lfiw2zB6zMSoj+FKRkUSSg2Cmz8HFl0hVzdmbf+xUk9njxGJpSVLgs8jgmNOPIU0twJkFA qy5S22OiCuDyp2dK2eTz61thcPlmwDA= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-148-QmkitUJ8PaW-9GFUGgQycQ-1; Fri, 11 Nov 2022 11:36:43 -0500 X-MC-Unique: QmkitUJ8PaW-9GFUGgQycQ-1 Received: by mail-qt1-f198.google.com with SMTP id cm12-20020a05622a250c00b003a521f66e8eso3942758qtb.17 for ; Fri, 11 Nov 2022 08:36:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=AJiBi3KVh4t5LkwYToZWuJjU26pF8WCSmWElXgF1rQw=; b=MHmngdEg9Xyym7DMLuix4U3bP6mPCX1um0Kdgaqrh8j09rrJmIGPZAA8OaiHLNZUog PJXbQ+iMyLW/271U3EZmyyrYpM51J7/hi/GvtcjhMxQOYdyepFJonCLLRSf7DHZwXrvY fQYPXEU22YhjxrAEeuG0FBYzetfbyZK9cn7wGfarKzeeY+XxJeHJuzSBlLN3/EIaHJ/C p4gMOo8B1/TPsMzf5ECVG4FqrbG4JqGY4A+Ny8189O+RnBw79v1AtLw0nE81BbpOsmzp ubeGG7Jy/JglHdAeXmvNIFsDHyoTS/LzvwAsBI7d9ZOtM4kcLtdPMKCq+w+cfC7KBoCf g5MA== X-Gm-Message-State: ANoB5pl1BRPtPL50xoRVGWDCA55vlrLVhZhkbKUw7Ov5ScLN/UV2586C dba5oto5LujshtSAgZBVI+AMxRbv2yUBu75PnNc+12k+ptvKm2Jn+i/4eMHRQEE+kZLPzuR4lAi Io+5TE+Zh5mOtpkbI3xcBq2gCDMuHRHsPB2keFEVl5q3BtcN84FoCH3O2ofDwnmHpDgUYP1sI8g == X-Received: by 2002:a05:622a:1a86:b0:3a5:8a24:e6bf with SMTP id s6-20020a05622a1a8600b003a58a24e6bfmr2018333qtc.529.1668184602469; Fri, 11 Nov 2022 08:36:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf7YneHyDBE2vDvznSXNiFPCvwcurdhq1LQ9u98v7Xyn1wsWHYpcWXCnqgl3RBy7be+1YhW9Dg== X-Received: by 2002:a05:622a:1a86:b0:3a5:8a24:e6bf with SMTP id s6-20020a05622a1a8600b003a58a24e6bfmr2018305qtc.529.1668184602145; Fri, 11 Nov 2022 08:36:42 -0800 (PST) Received: from localhost ([31.111.84.238]) by smtp.gmail.com with ESMTPSA id u12-20020a05620a084c00b006bc192d277csm1642138qku.10.2022.11.11.08.36.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 08:36:41 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 5/6] gdb/testsuite: fix gdb.debuginfod/fetch_src_and_symbols.exp with Clang Date: Fri, 11 Nov 2022 16:36:24 +0000 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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 List-Id: The gdb.debuginfod/fetch_src_and_symbols.exp test is showing a single failure when run with some older versions of Clang, e.g. 9.0.1. The problem appears to be with Clang's generated line table. The test source looks like this: int main() { asm ("main_label: .globl main_label"); return 0; } In GDB, when we 'start', we expect to stop at the 'return 0;' line. This is the behaviour when the compiler is gcc, or later versions of Clang. However, with Clang 9.0.2, I see GDB stop on the 'asm' line. I propose adding some code to the test script to step GDB onto the next line if we stop on the 'asm' line. With this change in place, I now see the test fully passing with Clang 9.0.1 and 15.0.2, as well as with gcc. --- .../gdb.debuginfod/fetch_src_and_symbols.exp | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp b/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp index b57b3201cf7..cebaa435102 100644 --- a/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp +++ b/gdb/testsuite/gdb.debuginfod/fetch_src_and_symbols.exp @@ -161,6 +161,27 @@ proc_with_prefix no_url { } { if ![runto_main] { return -1 } + + # Some older versions of Clang (e.g. 9.0.1) were observed stopped + # at the 'asm' line rather than the 'return' line in main.c. This + # messes up some of the expected patterns later in the test. + set rtn_lineno [gdb_get_line_number "return 0;"] + set prev_lineno [expr $rtn_lineno - 1] + gdb_test_multiple "info line" "" { + -wrap -re "\r\nLine ${prev_lineno} of .*" { + gdb_test "step" + pass $gdb_test_name + } + -wrap -re "\r\nLine ${rtn_lineno} of .*" { + pass $gdb_test_name + } + -wrap -re "\r\nLine ${::decimal} of .*" { + # Not sure what line this stopped on, but later tests are + # probably going to fail. + fail $gdb_test_name + } + } + gdb_test "generate-core-file $::corefile" "Saved corefile $::corefile" \ "file [file tail $::corefile] gen" file rename -force ${binfile}2 $debugdir -- 2.25.4