From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31342 invoked by alias); 3 Jun 2010 15:35:15 -0000 Received: (qmail 31319 invoked by uid 22791); 3 Jun 2010 15:35:14 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 Jun 2010 15:35:07 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 3B68E2BACB4; Thu, 3 Jun 2010 11:35:05 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 23xNa6+OLFoo; Thu, 3 Jun 2010 11:35:05 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id F00042BABB9; Thu, 3 Jun 2010 11:35:04 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 1EAA6F58FA; Thu, 3 Jun 2010 08:34:59 -0700 (PDT) Date: Thu, 03 Jun 2010 15:35:00 -0000 From: Joel Brobecker To: Doug Evans Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [RFA/python:2/2] First script in GDB python library - command/pahole.py Message-ID: <20100603153459.GK3019@adacore.com> References: <1274918921-23200-1-git-send-email-brobecker@adacore.com> <1274918921-23200-3-git-send-email-brobecker@adacore.com> <20100603001115.GJ3019@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2010-06/txt/msg00099.txt.bz2 > $dir/commands/prefix.py > $dir/commands/prefix/subprefix.py > $dir/commands/prefix/subprefix/my-command.py > > just have > > $dir/commands/prefix/subprefix/my-command.py > > I like the consistency of the former, but I'm not sure what to do > about prefixes that already exist, e.g. enable, disable. Hmm, right, I hadn't thought about that. IMO, there should not be a prefix.py or subprefix.py if that prefix/subprefix command is not a valid command in itself, or if the command already exists. > Or what to do if there are multiple command directories and several > have commands with the same prefix. I guess we'll have to think about that one too, eventually. I think the thing to do when that can happen is to print a warning/error saying that such and such py script could not be run because it collides with another script that was run earlier. Or print a warning saying that a given command from such and such script was overriden by such and such script (we might want to give precedence to user-provided scripts over system-provided scripts for instance). > Prescanning the directories and creating stubs sounds reasonable. > How much of a stub though? > In addition to command completion there is help and apropos. I think that if we want to have help and apropos working, we might as well just use the simpler approach of running the command scripts right from the start. I'd be OK with that too, and it's certainly much simpler to work on. Otherwise, to get the help, we'd have to either evaluate part of the script, or find a way to provide that information without doing the evaluation. Either way, I think that it would take us past the overkill point. -- Joel