From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id DB82C386EC42 for ; Fri, 24 Apr 2020 14:38:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org DB82C386EC42 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.193] (unknown [192.222.164.54]) (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 5B6FE1F3AF; Fri, 24 Apr 2020 10:38:48 -0400 (EDT) Subject: Re: [PATCH] Tune default DEBUGDIR for NetBSD To: Christian Biesinger , Kamil Rytarowski Cc: gdb-patches References: <20200408171543.6061-1-n54@gmx.com> <47fe1112-261b-6d31-3ec4-1cb3ed27ea64@gmx.com> From: Simon Marchi Message-ID: Date: Fri, 24 Apr 2020 10:38:47 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: tl Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-22.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP 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: Fri, 24 Apr 2020 14:38:52 -0000 On 2020-04-08 1:28 p.m., Christian Biesinger via Gdb-patches wrote: > On Wed, Apr 8, 2020 at 12:21 PM Kamil Rytarowski wrote: >> >> On 08.04.2020 19:18, Christian Biesinger wrote: >>> On Wed, Apr 8, 2020 at 12:16 PM Kamil Rytarowski wrote: >>>> >>>> NetBSD uses a custom debug file directory /usr/libdata/debug >>>> for the basesystem and does not use separate debug files in >>>> pkgsrc (3rd party package collections). >>>> >>>> gdb/ChangeLog: >>>> >>>> * configure.ac: Handle NetBSD specific DEBUGDIR. >>>> * configure: Regenerate. >>>> --- >>>> gdb/ChangeLog | 5 +++++ >>>> gdb/configure | 11 ++++++++++- >>>> gdb/configure.ac | 11 ++++++++++- >>>> 3 files changed, 25 insertions(+), 2 deletions(-) >>>> >>>> diff --git a/gdb/ChangeLog b/gdb/ChangeLog >>>> index 7ea85799211..af6844b6ace 100644 >>>> --- a/gdb/ChangeLog >>>> +++ b/gdb/ChangeLog >>>> @@ -1,3 +1,8 @@ >>>> +2020-04-08 Kamil Rytarowski >>>> + >>>> + * configure.ac: Handle NetBSD specific DEBUGDIR. >>>> + * configure: Regenerate. >>>> + >>>> 2020-04-08 Simon Marchi >>>> >>>> * dwarf2/read.c (read_gdb_index_from_buffer): Remove objfile >>>> diff --git a/gdb/configure b/gdb/configure >>>> index afafc2c8d18..636a3f69f00 100755 >>>> --- a/gdb/configure >>>> +++ b/gdb/configure >>>> @@ -6416,6 +6416,15 @@ if test x"$gdb_cv_have_makeinfo_click" = xyes; then >>>> fi >>>> >>>> >>>> +case "${host}" in >>>> + *-*-netbsd*) >>>> + DEFAULTDEBUGDIR=/usr/libdata/debug >>> >>> Wouldn't it be better to make this ${prefix}/libdata/debug? >>> >> >> Not really, as this path specifies the userland debug files only. In >> third party we don't use separate debug files. The default prefix is >> /usr/local and without specifying --prefix=/usr debug files won't work. >> >> This path is already hardcoded in LLDB for this OS. > > Oh, I see -- you're saying that GDB will usually be configured with as > /usr/local prefix, but is still expected to find system debug data in > /usr/libdata/debug. Makes sense. I'm not terribly opposed to the hard-coded path, but I'm more concerned that we will have different behaviors for NetBSD and Linux, when we face pretty much the same situation. On Linux, if you build GDB by hand, you end up with /usr/local/lib/debug as the debugdir, when 99.9% of the time you actually want /usr/lib/debug. I've been bitten by this in the past, before I learned about that, and I think users constantly get bitten by it. So, for the moment, could you consider making it ${prefix}/libdata/debug, and stick --with-separate-debug-dir=/usr/libdata/debug in your pkgsrc? We can then discuss more broadly about making the default value /usr/lib/debug on Linux and /usr/libdata/debug on NetBSD, keeping both behaviors in sync. Simon