From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16084 invoked by alias); 24 Aug 2012 16:11:45 -0000 Received: (qmail 16065 invoked by uid 22791); 24 Aug 2012 16:11:42 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 24 Aug 2012 16:11:18 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7OGBG11014158 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 24 Aug 2012 12:11:17 -0400 Received: from host2.jankratochvil.net (ovpn-116-37.ams2.redhat.com [10.36.116.37]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q7OGBC5q032236 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 24 Aug 2012 12:11:15 -0400 Date: Fri, 24 Aug 2012 16:11:00 -0000 From: Jan Kratochvil To: Eli Zaretskii Cc: gdb-patches@sourceware.org, dje@google.com Subject: Re: [patch+7.5] auto-load: User conveniences suggested by Doug Evans Message-ID: <20120824161059.GC7200@host2.jankratochvil.net> References: <20120821144355.GA28426@host2.jankratochvil.net> <83k3wsb0da.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83k3wsb0da.fsf@gnu.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 X-SW-Source: 2012-08/txt/msg00735.txt.bz2 On Tue, 21 Aug 2012 19:50:25 +0200, Eli Zaretskii wrote: > > + if (!advice_printed) > > + { > > + const char *homedir = getenv ("HOME"); > > + char *homeinit; > > + > > + if (homedir == NULL) > > + homedir = "$HOME"; > > This should fall back on $USERPROFILE or on $APPDATA on MS-Windows if > $HOME is not defined. $USERPROFILE/$APPDATA are Windows equivalents > of $HOME, but some Windows users (including yours truly) set $HOME to > another directory (e.g., I don't like having my precious files on a > system disk, because disasters strike there more frequently). GDB main.c get_init_files does just: homedir = getenv ("HOME"); So if getenv ("HOME") does not work GDB will not find such .gdbinit file anyway. GDB maybe should do on MS-Windows also getenv ("USERPROFILE") etc. but that is an unrelated issue needing a fix in main.c get_init_files first. That part if (homedir == NULL) homedir = "$HOME"; may apply for MinGW but it tries to suggest you should 'set HOME c:\' for example first. It is very MinGW specific problem. Any change here without change in main.c get_init_files does not make sense. > > + printf_filtered (_("\ > > +To enable execution of this file add \"add-auto-load-safe-path %s\" \ > > +line to \"%s\".\n\ > > Suggest to move the "add-auto-load-safe-path" part to a new line, > because the file name displayed after that will probably overflow the > terminal line. Even the line "add-auto-load-safe-path %s" itself may and will overflow the terminal line. I do not find it such a problem, any terminal wraps lines and most terminals nowadays are several times wider than 80 columns so I do not think it makes sense to artifically wrap lines for them. If the user wants the output more narrow let she narrow her terminal. > > + scripts_directory_help = xstrprintf (_("\ > > +Automatically loaded %s%s%sGDB scripts\n\ > > +(named OBJFILE%s) are located in one of the directories listed by this\n\ > > +option.\n\ > > +This option is ignored for the kinds of scripts \ > > +having 'set auto-load ... off'.\n\ > > +Directories listed here need to be present also \ > > +in the 'set auto-load safe-path'\n\ > > +option."), > > Here, the lines are unnecessarily too short, IMO. I think there should be some clear decision what should the GDB output conform to. In this and the paragraph above we have exactly opposite opinions whether to wrap the text or not. My opinion: So far I believe constant text should be formatted to 80 columns, which is terrible to read but it should conform to GNU Coding Style like the source does. But when there is some variable text (%s) contained therein one cannot expect how the variable text is wide so one can leave it wide enough. > > -Set the list of directories from which it is safe to auto-load files."), _("\ > > -Show the list of directories from which it is safe to auto-load files."), _("\ > > +Set the list of paths from which it is safe to auto-load files."), _("\ > > +Show the list of paths from which it is safe to auto-load files."), _("\ > > Why "paths" instead of directories? GNU Coding Standards frown on > using "paths" with this semantics. > > If the problem is that these can be both files and directories, Yes. > let's say "list of files and directories that are safe for auto-loading". OK. I hope you are fine with "path" in the second part: -for the 'set auto-load ...' options. Each directory can be also shell\n\ +for the 'set auto-load ...' options. Each path entry can be also shell\n\ wildcard pattern; '*' does not match directory separator.\n\ Thanks, Jan