From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 56821 invoked by alias); 21 Aug 2019 18:54:00 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 56813 invoked by uid 89); 21 Aug 2019 18:54:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 21 Aug 2019 18:53:58 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7CC58368CF; Wed, 21 Aug 2019 18:53:57 +0000 (UTC) Received: from localhost (unused-10-15-17-196.yyz.redhat.com [10.15.17.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3DD6160BF3; Wed, 21 Aug 2019 18:53:57 +0000 (UTC) From: Sergio Durigan Junior To: "Christian Biesinger via gdb-patches" Cc: Pedro Alves , Christian Biesinger Subject: Re: [PATCH 0/3] [RFC] Load gdbinit files from a directory References: <20190820221745.147370-1-cbiesinger@google.com> Date: Wed, 21 Aug 2019 18:54:00 -0000 In-Reply-To: (Christian Biesinger via gdb-patches's message of "Wed, 21 Aug 2019 13:33:08 -0500") Message-ID: <87d0gyfiyj.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg00509.txt.bz2 On Wednesday, August 21 2019, Christian Biesinger via gdb-patches wrote: > On Wed, Aug 21, 2019 at 1:13 PM Pedro Alves wrote: >> On 8/20/19 11:17 PM, Christian Biesinger via gdb-patches wrote: >> > This patch series is some refactoring and then a patch to load gdbinit >> > files from a directory, instead of only allowing a single file. >> > >> > Fedora ships a system gdbinit file that does something similar; this >> > does this by default and also works if Python is disabled. >> >> Note that Fedora won't be able to replace the current mechanism with >> this, because it also loads Python files from the dir: >> >> python >> import glob >> # glob.iglob is not available in python-2.4 (RHEL-5). >> for f in glob.glob('/etc/gdbinit.d/*.gdb'): >> gdb.execute('source %s' % f) >> for f in glob.glob('/etc/gdbinit.d/*.py'): >> gdb.execute('source %s' % f) >> end >> >> So we'd need an additional "--with-system-python-scripts-dir" >> for Python scripts or some such. > > That's a good point. I don't think -with-system-python-scripts-dir > would really work for Fedora either since the directory there is > currently the same but I could change the patch to use > get_ext_lang_of_file/ext_lang_script_sourcer (which is effectively > pretty similar to the current Fedora gdbinit) I don't think we need to have separate directories for Python/Guile/"native" GDB scripts. I think we should consolidate all of these scripts inside one directory. >> Speaking of Python scripts, I guess Fedora's script should be >> loading Guile scripts as well. Guile support has been (temporarily?) disabled in Fedora GDB. > I agree. (Certainly if GDB shipped a default gdbinit like that, it > should do that) >> That isn't to say that I object to your patchset, TBC. I just >> see it a bit under the "why do it in C when you can script" light. >> Of course the answer can reasonably be "I need this without Python". > > So there were two reasons why I liked this approach: > - This ships something with GDB, that will work on all Linux > distributions the same way, as long as they agree on a directory > location I think /etc/gdbinit.d/ is a nice location, and I intend to keep using it for Fedora GDB and to make Debian GDB use it as well. I agree that supporting other directories, like ~/.gdbinit.d/, would be great. -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/