From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24090 invoked by alias); 13 Nov 2011 13:29:59 -0000 Received: (qmail 24081 invoked by uid 22791); 13 Nov 2011 13:29:58 -0000 X-SWARE-Spam-Status: No, hits=-7.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,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; Sun, 13 Nov 2011 13:29:39 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pADDTYAF016398 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 13 Nov 2011 08:29:35 -0500 Received: from psique ([10.3.112.3]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id pADDTTjx022515; Sun, 13 Nov 2011 08:29:32 -0500 From: Sergio Durigan Junior To: Robert Lupton the Good Cc: gdb@sourceware.org Subject: Re: Patch to add argument parsing classes to gdb References: <412F240F-46E7-4A5C-8207-721E15A58B6D@astro.princeton.edu> Date: Sun, 13 Nov 2011 13:29:00 -0000 In-Reply-To: <412F240F-46E7-4A5C-8207-721E15A58B6D@astro.princeton.edu> (Robert Lupton the Good's message of "Fri, 11 Nov 2011 14:38:33 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-11/txt/msg00089.txt.bz2 Hi Robert, Robert Lupton the Good writes: > I'm attaching a patch that implements two classes, GdbOptionParser and > GdbArgumentParser, which are built around python's standard optparse > and argparse but play well with gdb (e.g. don't call exit if you make > a typo or ask for help!). The code imports with python >= 2.3, but > only provides the argparse-based parser if you actually have argparse > in your path (python == 2.7?). > > The patch: > Implements the classes > Adds docs > Adds test cases > > What else do you need to get this into the source tree? I'm not sure > how to deal with copyright assignment. The right place to submit patches is not this list. You should rather use gdb-patches@sourceware.org. About copyright assignment, I can send you the form if you want. Also, you need to write a ChangeLog entry for this. And I'd suggest cleaning the patch a bit, because it contains some useless lines like: > ? .deps > cvs diff: Diffing . > Index: utils.c > =================================================================== > RCS file: /cvs/src/src/gdb/utils.c,v > retrieving revision 1.265 > diff -a -c -w -r1.265 utils.c > *** utils.c 4 Nov 2011 16:45:12 -0000 1.265 > --- utils.c 11 Nov 2011 19:20:09 -0000 > *************** > *** 729,736 **** > --- 729,740 ---- > struct timeval now_wall_time, delta_wall_time; > > gettimeofday (&now_wall_time, NULL); > + #if 0 /* no timeval_sub */ > timeval_sub (&delta_wall_time, > &now_wall_time, &start_stats->start_wall_time); > + #else > + delta_wall_time.tv_sec = delta_wall_time.tv_usec = 0; /* HACK */ > + #endif If this is a hack, then it should be fixed before submitting the patch. Have you run a regression test against this patch? It is a common practice, and should be always done. Otherwise, thanks for the work.