From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id QXMZOMVmzmkQ9QMAWB0awg (envelope-from ) for ; Thu, 02 Apr 2026 08:53:25 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=XsXTtRaa; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id E1A1E1E0BC; Thu, 02 Apr 2026 08:53:25 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.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,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 42BD81E04F for ; Thu, 02 Apr 2026 08:53:25 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 113634BA2E36 for ; Thu, 2 Apr 2026 12:53:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 113634BA2E36 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=XsXTtRaa Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 9DB604BA2E05 for ; Thu, 2 Apr 2026 12:52:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9DB604BA2E05 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9DB604BA2E05 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1775134379; cv=none; b=pEmioPuZxMxhtsjlVm0EPSiObkJCuj41EjnhvaEF/ebDOZRaFyqJ9ySvu5cb7qCDTHqwOtQJTjbI7cKnd+07Z2UtbplcDYpHOr2SmdQyTRnjobeUrcRqCt3jTCxHAM7y/evr3LJCW5qhKkxPGla53DOED0GIXfQ+AW7BpZ2ey0g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1775134379; c=relaxed/simple; bh=YlD55S/GciESaej6bxRn4I56XJ/TAp/AceXmSJCVDeE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=vnAu9kwLGc/f+hdXjltq6uZ5qXIyapoqj57Olc5nqKG23FTiwN4K2fyDpKtl1HcutuNNLv/ROmA7O/Ls901nlPI1p0vYUR9nYF3D0SFAZniHPdXGI5SFAvKd8Srai3OQFNcMx6ACT+9eeIdFBFjfkTeHWtCTkJt0wH4oq6O073I= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9DB604BA2E05 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1775134379; 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: in-reply-to:in-reply-to:references:references; bh=Z6nKVDFYPgdf9CDSwsZkYBqfR7Yh+VN8tsWGHFeuVfA=; b=XsXTtRaaPHmzWXz7Exz0EP9hfSz6y07MGdlgzpc62IShjLmARsrF4AbwJsp06zh+rruggW jB70zak7dys2Sug/XlaowMBXHp/No2TUNEgSw5XRzAWWXWGpsjxiVageSSvZaeVqxaq8/h w22Zfdy+k+S3jblD2evInewZQMPe9aE= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-3-HpQN9QU2NQy7idv3Hmd6yw-1; Thu, 02 Apr 2026 08:52:58 -0400 X-MC-Unique: HpQN9QU2NQy7idv3Hmd6yw-1 X-Mimecast-MFC-AGG-ID: HpQN9QU2NQy7idv3Hmd6yw_1775134377 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4887d32788bso6484575e9.0 for ; Thu, 02 Apr 2026 05:52:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775134377; x=1775739177; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Z6nKVDFYPgdf9CDSwsZkYBqfR7Yh+VN8tsWGHFeuVfA=; b=COmWC5mj4l2AYDrKdy8V+7QEooJrk6JdvMq8qTukZTJ9PXihlMVHkLRobfwChLGZFO ftKBALHKKff2JDewpgE8A6AXa4ceGY+HkkOosKezORuXcOSJ03o4vbNsGBoPDoFruNVD A6WZvdXluYRF97V7gjsXVwblvaTNZJXlo1lNREAGAIoPlC1ZA0b14diTMMCZwyD5JHnB mie1D18ASn7IWqPoGAh8iSkqZlu4mrYDbyLPo7WztwwuGcJrYrEIX/sTT1uAHa+zwr3q PtI/wRYPiH19VxTp8dJyNTsEXFLMaQHxlbodwgRD1lViud5XvKerI1jvuHwZm/AUdt8z FZhQ== X-Forwarded-Encrypted: i=1; AJvYcCXbQ9VdElug2lqr5IWiDtwuNNdB8BO+7biIyte3Eyzu0UF7XRRyuYVXxHfcjt/zDmm9WKne31fWsvQKGw==@sourceware.org X-Gm-Message-State: AOJu0YwxhH/cf/v/iCepjaJUc0Z8S+HoxVgMU5pRH09mq2dAEbAWYK6N lof4J1/KDzcccD2k1mMCCYeEdz5HdJHnQ81QtfGH6cwK/UvjxxFxfT9vB80A7sOERHKXurgPMaF DzgYmOgO8BcHJbNhUmPahVa1pDnGx/CMWHopNSferWXS76JR+aopbMHvt49GHi0U= X-Gm-Gg: ATEYQzxp6UDUfyLKLX51+bxciUywr+d/E157r2sYTMgrLCJx6Fb3TKvSvQKNwmdZCGH ORHvlZocsoUouFEVP+Dls4kobfHAfovjsn94yMSgERw1v0gS+bNic2mEJLmd0wSiPXtZ2dagZfh 5EAwjp/m3ehFwA0s0qLHqHUxC5HYFA1s0Q+0A0uC2NCEdyJRDsoJC6iIdsSnzLYB6uGankwZU4j w8HI86kd6YdY2WKUz9VeuT5txKhrH8fppsQHhq1D9EuD7Gz10Vp/bQmxlzCX3GnZ2z9XFFIjgyy xJbjd+9TDhTPnC+7ZQRJ9PNl9v/+ZR1lYDO7R7itVTlb/QMsK1TzCbGmj1lavVhIoCuezG85cOt QgVGPWF+odmw8ex5Y X-Received: by 2002:a05:600c:638e:b0:487:1fc:14f9 with SMTP id 5b1f17b1804b1-4888b769917mr47394405e9.15.1775134376737; Thu, 02 Apr 2026 05:52:56 -0700 (PDT) X-Received: by 2002:a05:600c:638e:b0:487:1fc:14f9 with SMTP id 5b1f17b1804b1-4888b769917mr47394055e9.15.1775134376271; Thu, 02 Apr 2026 05:52:56 -0700 (PDT) Received: from localhost ([31.111.84.232]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4887adadf4fsm66870615e9.11.2026.04.02.05.52.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Apr 2026 05:52:55 -0700 (PDT) From: Andrew Burgess To: Bratislav Filipovic Cc: bfilipov@amd.com, gdb-patches@sourceware.org, simon.marchi@efficios.com Subject: Re: [PATCH] test: basename filenames in dwarf2 frame checks In-Reply-To: <20260402102559.323847-1-bfilipov@amd.com> References: <87a4vl659l.fsf@redhat.com> <20260402102559.323847-1-bfilipov@amd.com> Date: Thu, 02 Apr 2026 13:52:55 +0100 Message-ID: <874ilt5xso.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: DgpwtRbc0seoplS8-GcSW6tnKIeZkLcxlGJ-go_2Bdo_1775134377 X-Mimecast-Originator: redhat.com Content-Type: text/plain 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 Bratislav Filipovic writes: > Some gdb.dwarf2 tests match the output of commands like frame and > expect to see locations printed as fission-base.c:LINE (no directory > prefix). When the test programs are built with clang as CC_FOR_TARGET, > GDB can print an absolute source path instead, causing FAILs. > > For example, with clang: > > (gdb) PASS: gdb.dwarf2/fission-base.exp: ptype func > (gdb) frame > #0 main () at /path/to/gdb/testsuite/fission-base.c:27 > 27 return func (-1); > (gdb) FAIL: gdb.dwarf2/fission-base.exp: frame in main > > With gcc: > > (gdb) PASS: gdb.dwarf2/fission-base.exp: ptype func > (gdb) frame > #0 main () at fission-base.c:27 > 27 return func (-1); > (gdb) PASS: gdb.dwarf2/fission-base.exp: frame in main > > The difference comes from the DWARF line table contents. With clang, > the .debug_line directory table can contain an absolute directory that > the file table entries reference: > > The Directory Table: > 0 /path/to/gdb/testsuite > > The File Name Table: > 0 Dir=0 Name=fission-base.c > 1 Dir=0 Name=fission-base.c > > Whereas with gcc the directory table is empty and only the bare filename > is present: > > The Directory Table is empty. > > The File Name Table: > 1 Name=fission-base.c > > This difference reflects toolchain/assembler behavior in how .file/.loc > are translated into .debug_line and is orthogonal to what these tests > aim to validate. > > Force set filename-display basename in the affected tests so the > output is stable across toolchains. > > Test: gdb.dwarf2/fission-base.exp (CC_FOR_TARGET=clang, gcc) > Test: gdb.dwarf2/dw2-undefined-ret-addr.exp (CC_FOR_TARGET=clang, gcc) > --- > > Thanks for the review Andrew. Fixed the comments. Looks good. Feel free to push this patch. Approved-By: Andrew Burgess Thanks, Andrew > > Regards Bratislav > > > gdb/testsuite/gdb.dwarf2/dw2-undefined-ret-addr.exp | 5 +++++ > gdb/testsuite/gdb.dwarf2/fission-base.exp | 5 +++++ > 2 files changed, 10 insertions(+) > > diff --git a/gdb/testsuite/gdb.dwarf2/dw2-undefined-ret-addr.exp b/gdb/testsuite/gdb.dwarf2/dw2-undefined-ret-addr.exp > index 32ddaf4a..88765d4f 100644 > --- a/gdb/testsuite/gdb.dwarf2/dw2-undefined-ret-addr.exp > +++ b/gdb/testsuite/gdb.dwarf2/dw2-undefined-ret-addr.exp > @@ -30,6 +30,11 @@ if {![runto "stop_frame"]} { > return -1 > } > > +# If test is compiled with clang, GDB would display absolute path. > +# This command keeps output consistent across toolchains. > + > +gdb_test_no_output "set filename-display basename" > + > # stop_frame should be the outermost frame. > > # Check that backtrace shows only frame #0. > diff --git a/gdb/testsuite/gdb.dwarf2/fission-base.exp b/gdb/testsuite/gdb.dwarf2/fission-base.exp > index 035fe731..d1abf6c9 100644 > --- a/gdb/testsuite/gdb.dwarf2/fission-base.exp > +++ b/gdb/testsuite/gdb.dwarf2/fission-base.exp > @@ -46,6 +46,11 @@ if {![runto_main]} { > gdb_test "ptype main" "type = int \\(\\)" > gdb_test "ptype func" "type = int \\(int\\)" > > +# If test is compiled with clang, GDB would display absolute path. > +# This command keeps output consistent across toolchains. > + > +gdb_test_no_output "set filename-display basename" > + > gdb_test "frame" "#0 *main \\(\\) at $testfile\\.c:$decimal.*" \ > "frame in main" > > -- > 2.43.0