From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7398 invoked by alias); 13 Sep 2014 22:55:46 -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 7361 invoked by uid 89); 13 Sep 2014 22:55:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-pa0-f47.google.com Received: from mail-pa0-f47.google.com (HELO mail-pa0-f47.google.com) (209.85.220.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 13 Sep 2014 22:55:43 +0000 Received: by mail-pa0-f47.google.com with SMTP id ey11so3879570pad.6 for ; Sat, 13 Sep 2014 15:55:41 -0700 (PDT) X-Received: by 10.68.134.130 with SMTP id pk2mr25962940pbb.133.1410648941412; Sat, 13 Sep 2014 15:55:41 -0700 (PDT) Received: from seba.sebabeach.org.gmail.com (173-13-178-50-sfba.hfc.comcastbusiness.net. [173.13.178.50]) by mx.google.com with ESMTPSA id oh7sm7420847pdb.68.2014.09.13.15.55.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Sep 2014 15:55:40 -0700 (PDT) From: Doug Evans To: gdb-patches@sourceware.org Subject: Re: [PATCH] Change form of prompt argument to with_gdb_prompt. References: Date: Sat, 13 Sep 2014 22:55:00 -0000 In-Reply-To: (Doug Evans's message of "Sat, 06 Sep 2014 12:15:00 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2014-09/txt/msg00475.txt.bz2 Doug Evans writes: > Hi. > > I had occasion to use with_gdb_prompt in a test for the patch for PR 17314 > and was passing the plain text prompt as the value, "(top-gdb)", > instead of a regexp, "\(top-gdb\)" (expressed as "\\(top-gdb\\)" in TCL). > > I then discovered that in order to restore the prompt gdb passes the > original value of $gdb_prompt to "set prompt", which works because > "set prompt \(gdb\) " is equivalent to "set prompt (gdb) ". > Perhaps I'm being overly cautious but this feels a bit subtle, > but at any rate as an API choice I'd much rather pass the plain text > form to with_gdb_prompt. The comments added to with_gdb_prompt feel > a bit wordy ... excessive FAOD? > > I also discovered that the initial value of gdb_prompt is set in > two places to two different values. > At the global level gdb.exp sets it to "\[(\]gdb\[)\]" > and default_gdb_init sets it to "\\(gdb\\)". > The former form is undesirable as an argument to "set prompt", > but it's not clear to me that just deleting this code won't break > anything. Thus I just changed the value to be consistent and added > a comment. > > 2014-09-06 Doug Evans > > * lib/gdb.exp (gdb_prompt): Add comment and change initial value to > be consistent with what default_gdb_init uses. > (with_gdb_prompt): Change form of PROMPT argument from a regexp to > the plain text of the prompt. Add some logging printfs. > * gdb.perf/disassemble.exp: Update call to with_gdb_prompt. Committed.