From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id E318F3858D37 for ; Thu, 21 Apr 2022 20:26:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E318F3858D37 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 23LKQqrQ016051 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 Apr 2022 16:26:57 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 23LKQqrQ016051 Received: from [172.16.0.95] (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 3BD161E00D; Thu, 21 Apr 2022 16:26:52 -0400 (EDT) Message-ID: Date: Thu, 21 Apr 2022 16:26:51 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH 5/6] gdb: prepend comp_dir to symtab name in buildsym_compunit Content-Language: tl To: Hannes Domani , "gdb-patches@sourceware.org" References: <20220407015159.1734834-1-simon.marchi@polymtl.ca> <20220407015159.1734834-6-simon.marchi@polymtl.ca> <1505314165.4339353.1649344759459@mail.yahoo.com> <26fea9a4-4d27-0b7d-1e64-1f7918eb1044@polymtl.ca> <1324526060.2626775.1650538560421@mail.yahoo.com> From: Simon Marchi In-Reply-To: <1324526060.2626775.1650538560421@mail.yahoo.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 21 Apr 2022 20:26:52 +0000 X-Spam-Status: No, score=-3033.0 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Thu, 21 Apr 2022 20:26:59 -0000 On 2022-04-21 06:56, Hannes Domani wrote: > Am Donnerstag, 7. April 2022, 20:01:33 MESZ hat Simon Marchi Folgendes geschrieben: > >>> I came up with a different fix: >>> >>> --- a/gdb/dwarf2/line-header.c >>> +++ b/gdb/dwarf2/line-header.c >>> @@ -69,7 +69,11 @@ line_header::file_file_name (int file) const >>>       { >>>         const file_entry *fe = file_name_at (file); >>> >>> -      if (!IS_ABSOLUTE_PATH (fe->name)) >>> +      /* The directory index 0 always means the compilation directory. >>> +    For DWARF 4 and before because 0 means DW_AT_comp_dir, and >>> +    for DWARF 5 because the first entry of the directory table is >>> +    the compilation directory.  */ >>> +      if (!IS_ABSOLUTE_PATH (fe->name) && fe->d_index > 0) >>>       { >>>         const char *dir = fe->include_dir (this); >>>         if (dir != NULL) >>> >>> >>> But there is probably a good reason why you didn't choose this variant. >> >> I did have something like this as my first attempts: >> >>    https://review.lttng.org/c/binutils-gdb/+/7662/15/gdb/dwarf2/line-header.c >> >> But it does not make the test cases happy: >> >> FAIL: gdb.dwarf2/macro-source-path.exp: test_name=gcc11-ld238-absolute-cwd: is_64=true: print ONE >> FAIL: gdb.dwarf2/macro-source-path.exp: test_name=gcc11-ld238-absolute-cwd: is_64=true: print TWO >> FAIL: gdb.dwarf2/macro-source-path.exp: test_name=gcc11-ld238-absolute-cwd: is_64=false: print ONE >> FAIL: gdb.dwarf2/macro-source-path.exp: test_name=gcc11-ld238-absolute-cwd: is_64=false: print TWO >> FAIL: gdb.dwarf2/macro-source-path.exp: test_name=clang14-absolute-cwd: is_64=true: print ONE >> FAIL: gdb.dwarf2/macro-source-path.exp: test_name=clang14-absolute-cwd: is_64=true: print TWO >> FAIL: gdb.dwarf2/macro-source-path.exp: test_name=clang14-absolute-cwd: is_64=false: print ONE >> FAIL: gdb.dwarf2/macro-source-path.exp: test_name=clang14-absolute-cwd: is_64=false: print TWO >> >> Or on my current system (gcc 11 + ld 2.38): >> >> FAIL: gdb.base/macro-source-path.exp: absolute-cwd: print ONE >> FAIL: gdb.base/macro-source-path.exp: absolute-cwd: print TWO > > I wonder if this variant could still be applied to gdb-12-branch, since > it does fix most problems, and isn't very intrusive. > > > Hannes We could. I don't think I'll work on that myself, but if somebody else would like to submit something, I can review it. Simon