From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id IaQPBsfY2mZPDCIAWB0awg (envelope-from ) for ; Fri, 06 Sep 2024 06:26:15 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=gWqCLPSZ; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id F28131E353; Fri, 6 Sep 2024 06:26:14 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-9.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,URIBL_BLOCKED,URIBL_DBL_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=4.0.0 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 68F061E05C for ; Fri, 6 Sep 2024 06:26:14 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 982A6384A49E for ; Fri, 6 Sep 2024 10:26:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 982A6384A49E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1725618373; bh=GuibVjFz9Hq3V3gtRnRFB3OEoIIYj0+5R4qCsv9CWuY=; h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=gWqCLPSZm84uG+eM9QiLYmjCTTzgorD5YoTyibkwIobY8sk8/njROSYs4iTnAKOA0 wxx4+wEYbB2qqBsZqBDDtWvlMMFgfa8jtqShaM/QBfouNFd/SI6wYX7WiU1Zf/h0+Y BbVRLROoV+yjCEYxuxTcbLx+ORUt7r10bZWmW26s= Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id CE127384A80B for ; Fri, 6 Sep 2024 10:25:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CE127384A80B ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CE127384A80B ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725618330; cv=none; b=W8mP4qEy7wgOusA1V/oFhqPk3QytIZGjJN6Ikcdn9ka0ZwHXWSWtaw7pA5FGHWBpR6xq+VT9dCyeQMTwDvgKyOLPy3Qn0WawLSfuZlh+1yhTbnd+VPoOAXV+Q3ley/qCcgWENCY98k5k3ZT2lQTV2FYIqkkVNXtKSIOFdo+/2hM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725618330; c=relaxed/simple; bh=EIJeZOKJ8iNgI+Pxu0jqNbV0QrH2w44b5mRxfSIsWEY=; h=DKIM-Signature:Date:To:From:Subject:Message-ID:MIME-Version; b=tOSh1fjunHgz+JNfH3PQ+Gq+q7WGdOZ0UJxUs1e/+TN5gBHK1ypN1VdqZGTnGB0eVdaE0GOPekTsxy0wV3sNDkFDiH/+nYM0V7WtLpc05SL4zG0VmkIywat3h2VoOixxbi1O6xoWg2yJj29NotnNEf4RgqLhLhllHsjJFVQvLyU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from mail-4323.proton.ch ([185.70.43.23]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smW9W-0002o6-4q for gdb@gnu.org; Fri, 06 Sep 2024 06:25:21 -0400 Date: Fri, 06 Sep 2024 10:25:06 +0000 To: Brennan Vincent , gdb@gnu.org Subject: Re: Set debug-file-directory from environment variable? Message-ID: <03314c57ad5784b09e7658a0ff4928f1adf9100a.camel@vrany.io> In-Reply-To: <87plpif51o.fsf@taipei.mail-host-address-is-not-set> References: <87plpif51o.fsf@taipei.mail-host-address-is-not-set> Feedback-ID: 40767693:user:proton X-Pm-Message-ID: d5ad7846966f1405275859b77b6abe3419f0b73b MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.70.43.23; envelope-from=jan@vrany.io; helo=mail-4323.proton.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Jan Vrany via Gdb Reply-To: Jan Vrany Errors-To: gdb-bounces~public-inbox=simark.ca@sourceware.org Sender: "Gdb" Hi,=20 On Thu, 2024-09-05 at 12:17 -0400, Brennan Vincent wrote: > Hello, >=20 > Would folks be okay with a patch to take debug file directories from > an > environment variable, e.g. GDB_DEBUG_FILE_PATH ? >=20 > An example of when this is could be useful is for Guix users: the > variable could be automatically set up when spawning a Guix shell > that > contains debug packages. >=20 > But I'm guessing it would be useful in other situations too. >=20 If I understand you correctly, I think you can use Python to=C2=A0 do it (if your GDB has Python support). Something like putting following your .gdbinit (or to system-wide init script): ---8<---- python import os path_from_env =3D os.environ.get('GDB_DEBUG_FILE_PATH') if path_from_env is not None: old =3D gdb.parameter('debug-file-directory') new =3D old + ":" + path_from_env gdb.set_parameter('debug-file-directory', new) end ---8<---- Jan