From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28056 invoked by alias); 17 Jul 2006 09:29:46 -0000 Received: (qmail 28048 invoked by uid 22791); 17 Jul 2006 09:29:45 -0000 X-Spam-Check-By: sourceware.org Received: from fra-del-03.spheriq.net (HELO fra-del-03.spheriq.net) (195.46.51.99) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 17 Jul 2006 09:29:44 +0000 Received: from fra-out-01.spheriq.net (fra-out-01.spheriq.net [195.46.51.129]) by fra-del-03.spheriq.net with ESMTP id k6H9TeNF010091 for ; Mon, 17 Jul 2006 09:29:41 GMT Received: from fra-cus-01.spheriq.net (fra-cus-01.spheriq.net [195.46.51.37]) by fra-out-01.spheriq.net with ESMTP id k6H9TT9a027169 for ; Mon, 17 Jul 2006 09:29:36 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by fra-cus-01.spheriq.net with ESMTP id k6H9TNpl017183 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Mon, 17 Jul 2006 09:29:27 GMT Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9CA6DDA46; Mon, 17 Jul 2006 09:29:22 +0000 (GMT) Received: from mail1.bri.st.com (mail1.bri.st.com [164.129.8.218]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 0FDFB474B7; Mon, 17 Jul 2006 09:29:20 +0000 (GMT) Received: from [164.129.15.13] (bri1043.bri.st.com [164.129.15.13]) by mail1.bri.st.com (MOS 3.5.8-GR) with ESMTP id CHV19836 (AUTH stubbsa); Mon, 17 Jul 2006 10:29:17 +0100 (BST) Message-ID: <44BB586E.7040107@st.com> Date: Mon, 17 Jul 2006 09:29:00 -0000 From: Andrew STUBBS User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 To: Joel Brobecker Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] set/unset/show substitute-path commands (take 2) References: <20060715054902.GD1393@adacore.com> In-Reply-To: <20060715054902.GD1393@adacore.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-07/txt/msg00197.txt.bz2 Joel Brobecker wrote: > + /* If the list of rules are empty, then insert the new rule > + at the head of the list. */ > + > + if (substitute_path_rules == NULL) > + { > + substitute_path_rules = rule; > + return; > + } > + > + /* Otherwise, skip to the last rule in our list and then append > + the new rule. */ > + > + last = substitute_path_rules; > + while (last->next != NULL) > + last = last->next; > + > + last->next = rule; What if the user tries to substitute the same path twice? I think it should delete the old rule (maybe query) and add the new one to the end. > + /* If no rule matching the argument was found, then print an error > + message to the user. */ > + > + if (!rule_found) > + { > + if (from != NULL) > + error (_("No substitution rule defined for `%s'"), from); > + else > + error (_("No substitution rule defined")); Is the latter case really an error? I would have thought not, since there's no way for a script to check the status before giving the command. Andrew