From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8830 invoked by alias); 23 May 2010 17:32:28 -0000 Received: (qmail 8820 invoked by uid 22791); 23 May 2010 17:32:26 -0000 X-SWARE-Spam-Status: No, hits=0.0 required=5.0 tests=AWL,BAYES_20,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL,TW_RG X-Spam-Check-By: sourceware.org Received: from mtaout21.012.net.il (HELO mtaout21.012.net.il) (80.179.55.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 23 May 2010 17:32:21 +0000 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0L2V00H00V4I0C00@a-mtaout21.012.net.il> for gdb-patches@sourceware.org; Sun, 23 May 2010 20:32:05 +0300 (IDT) Received: from HOME-C4E4A596F7 ([84.229.45.48]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L2V00FHRVDGMU50@a-mtaout21.012.net.il>; Sun, 23 May 2010 20:32:05 +0300 (IDT) Date: Sun, 23 May 2010 18:55:00 -0000 From: Eli Zaretskii Subject: Re: [RFA] new python features: gdb.GdbError, gdb.string_to_argv In-reply-to: <20100522165438.5D5A48439A@ruffy.mtv.corp.google.com> To: dje@google.com (Doug Evans) Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83pr0mo76x.fsf@gnu.org> References: <20100522165438.5D5A48439A@ruffy.mtv.corp.google.com> 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: 2010-05/txt/msg00538.txt.bz2 > Date: Sat, 22 May 2010 09:54:38 -0700 (PDT) > From: dje@google.com (Doug Evans) > > While writing some gdb commands in python I needed to be able to > flag users errors without causing a traceback to be printed, > and I wanted a utility to translate the argument string into an argv. Thanks. > +When implementing @value{GDBN} commands in Python via @code{gdb.Command}, > +it is useful to be able to throw an exception that doesn't cause a > +traceback to be printed. For example, the user may have invoked the > +command incorrectly. Use the @code{gdb.GdbError} exception > +to handle this case. Example: I suggest a @findex entry about gdb.GdbError here. > +To break @var{argument} up into an argv-like string use > +@code{gdb.string_to_argv}. > +Arguments are separated by spaces and may be quoted. and a @findex entry here about gdb.string_to_argv. > --- NEWS 30 Apr 2010 07:04:52 -0000 1.379 > +++ NEWS 22 May 2010 16:51:50 -0000 > @@ -87,7 +87,9 @@ is now deprecated. > set/show in the CLI. > > ** New functions gdb.target_charset, gdb.target_wide_charset, > - gdb.progspaces, and gdb.current_progspace. > + gdb.progspaces, gdb.current_progspace, and gdb.string_to_argv. > + > +** New exception gdb.GdbError. This part is okay. Thanks.