From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7318 invoked by alias); 27 May 2014 20:24:45 -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 7305 invoked by uid 89); 27 May 2014 20:24:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mail-la0-f52.google.com Received: from mail-la0-f52.google.com (HELO mail-la0-f52.google.com) (209.85.215.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 27 May 2014 20:24:44 +0000 Received: by mail-la0-f52.google.com with SMTP id gl10so6811098lab.39 for ; Tue, 27 May 2014 13:24:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=8tPsPYDpFJhER1Tfu9iblRk9QhM9ntpZraFlcgB2Pa8=; b=DahnnST2ukL26/nXcpC/1aJXT6vt3ljYlOCpyjR6fB8j/cVK5QXRBS8QdlXTonYXGo f0LAMYKnKhrGVLsagltrvxyHVCKZvEmn4enGa6rwyfpQ9FH+0muuI5lbe4RUme5OW2R1 c7LE06521uuRKx3YZbxdCATIZgM765R/9o9cVIFHIWGP3gY/BwqKHzaQ5825KEhNHGDa WfIlA3JE9ga8RpcnJ0rTKhtHeDaQ5qiWeOPf3U/MXEvP+Ql5putj807V0tg/dPUMo6/a iBbQHsT5v+UChmnN7GEZ78uP+WHR7Jmt6agEUqmfGqvS+1PBgVaFDvMklnB33B/qeDZ5 G4fA== X-Gm-Message-State: ALoCoQm6phpoZGDRLxxwwunBkSvWYcLqeMnEZrZsWJXAy4MHr3EBkm6wJbgj5/3dHAyvETcV9qbO MIME-Version: 1.0 X-Received: by 10.112.150.130 with SMTP id ui2mr4526576lbb.80.1401222280526; Tue, 27 May 2014 13:24:40 -0700 (PDT) Received: by 10.112.171.6 with HTTP; Tue, 27 May 2014 13:24:40 -0700 (PDT) In-Reply-To: <5384C12C.2020602@broadcom.com> References: <87tx8ks8yv.fsf@fleche.redhat.com> <5384C12C.2020602@broadcom.com> Date: Tue, 27 May 2014 20:24:00 -0000 Message-ID: Subject: Re: [PATCH] Add autocompletion for convenience vars in print and set From: Daniel Gutson To: Andrew Burgess Cc: gdb-patches Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-05/txt/msg00680.txt.bz2 On Tue, May 27, 2014 at 1:45 PM, Andrew Burgess wro= te: > On 22/05/2014 4:17 PM, Daniel Gutson wrote: >> Second version. >> Comments below: >> >> On Tue, May 20, 2014 at 1:36 PM, Tom Tromey wrote: >>>>>>>> "Daniel" =3D=3D Daniel Gutson writes: >>> >>> Daniel> I could not find any testsuite where to add tests for this; if >>> Daniel> there are, please let me know. >>> >>> See testsuite/gdb.base/completion.exp >> >> Thanks, I ran all the tests and passed. I did not add a new test >> case though since I didn't check how to add a new convenience var >> and undefine it later from the test framework. (Should I try harder?) > > I'm not a maintainer, but you'll probably be asked for some tests of > this (really useful) feature. > > I don't think you need to worry about removing any convenience > variables you create, each .exp test file starts gdb afresh, > and sometime (look for clean_restart) gdb is restarted within > a single .exp file. > > For this feature you can probably get away with just adding some > new tests to the end of the completion.exp file, I've included an > example test in this mail, but you'll probably want some more. > > thanks, > Andrew > > > diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.ba= se/completion.exp > index 2608309..c028548 100644 > --- a/gdb/testsuite/gdb.base/completion.exp > +++ b/gdb/testsuite/gdb.base/completion.exp > @@ -747,6 +747,27 @@ gdb_test_multiple "" "$test" { > } > } > > +set test "complete '\$cv_'" > +gdb_test_no_output "set \$cv_aaa =3D 4" \ > + "Create convenience variable \$cv_aaa" > +send_gdb "p \$cv_" > +gdb_test_multiple "" "$test" { > + -re "^p \\\$cv_" { > + send_gdb "\t" > + gdb_test_multiple "" "$test" { > + -re "aaa $" { > + send_gdb "\n" > + gdb_test_multiple "" "$test" { > + -re "\\\$\[0-9\]+ =3D 4.*$gdb_prompt $" { > + pass "$test" > + } > + } > + } > + } > + } > +} > + > + > # Restore globals modified in this test... > set timeout $oldtimeout1 Thanks Andrew! > > > > --=20 Daniel F. Gutson Chief Engineering Officer, SPD San Lorenzo 47, 3rd Floor, Office 5 C=C3=B3rdoba, Argentina Phone: +54 351 4217888 / +54 351 4218211 Skype: dgutson