From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 04F8A3858C50; Thu, 3 Nov 2022 13:14:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 04F8A3858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667481268; bh=NX5wXAKfx57A3FdTjN5/rUBTXWQn4KmDIHb6CpGLwuw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=fXBKAQSsn2U0NLlV1GiwmA5ZJhtL+bkrsSjX8a/y96EIiXuPnnddlehePAK1IHCMx SmXWuwFt6fh5bjuQoemzaYRKCtPMdTuzL60YAj6A+ei/qOLVE2raRLodzTdL9UUcay ToqfeRLIj7MSlIgQJCBk9rv5IZaarCNQqqfpSZno= From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug macros/29034] Can't print macros defined on the command-line with binaries built with clang Date: Thu, 03 Nov 2022 13:14:08 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: macros X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29034 --- Comment #2 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Bruno Larsen : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3De7e7469e7a31= bd5a406a03aa83a1cd648f5ef30d commit e7e7469e7a31bd5a406a03aa83a1cd648f5ef30d Author: Bruno Larsen Date: Wed Apr 20 14:41:11 2022 -0300 gdb: Fix issue with Clang CLI macros Clang up to version 15 (current) adds macros that were defined in the command line or by "other means", according to the Dwarf specification, after the last DW_MACRO_end_file, instead of before the first DW_MACRO_start_file, as the specification dictates. When GDB reads the macros after the last file is closed, the macros never end up "in scope" and so we can't print them. This has been submitted as a bug to Clang developers (https://github.com/llvm/llvm-project/issues/54506), and PR macros/29034 was opened for GDB to keep track of this. Seeing as there is no expected date for it to be fixed, add a workaround for all current versions of Clang. The workaround detects when the main file would be closed and if the producer is Clang, and turns that operation into a noop, so we keep a reference to the current_file as those macros are read. A test case was added to confirm the functionality, and the KFAIL for running gdb.base/macro-source-path when using clang. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29034 Approved-By: Simon Marchi --=20 You are receiving this mail because: You are on the CC list for the bug.=