From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30125 invoked by alias); 22 Sep 2007 13:58:44 -0000 Received: (qmail 30115 invoked by uid 22791); 22 Sep 2007 13:58:43 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 22 Sep 2007 13:58:41 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 76832982AD; Sat, 22 Sep 2007 13:58:40 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 275C99812E; Sat, 22 Sep 2007 13:58:40 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1IZ5VH-0001ig-3b; Sat, 22 Sep 2007 09:58:39 -0400 Date: Sat, 22 Sep 2007 13:58:00 -0000 From: Daniel Jacobowitz To: Eli Zaretskii Cc: denis.pilat@st.com, gdb-patches@sourceware.org Subject: Re: [RFC] usage of environment variable from the command line Message-ID: <20070922135839.GA6285@caradoc.them.org> Mail-Followup-To: Eli Zaretskii , denis.pilat@st.com, gdb-patches@sourceware.org References: <46F13F2A.8010507@st.com> <20070921225527.GA28500@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.15 (2007-04-09) 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: 2007-09/txt/msg00298.txt.bz2 On Sat, Sep 22, 2007 at 09:16:38AM +0200, Eli Zaretskii wrote: > > Before we go ahead with this can anyone think of a better one that > > won't conflict with source language expressions? > > How about env("FOO") ? Or maybe $env("FOO"), to avoid a possibility > that the debuggee has a real function by the name of `env'? I like $env("FOO") or $ENV("FOO"). > > Another problem is escaping. Right now, you're supposed to be able to > > give either quoted strings or raw text to most commands (it > > varies, I posted a summary a while back). Front ends won't know how > > to escape the string if you have e.g. %% in your $PWD or want to > > print a string containing %%. > > The above suggestion solves this problem as well, I think. Mostly yes. The context where environment variables would be most useful is in places we don't take expressions, like after the "file" command; we've been changing those to take quoted strings to handle spaces and backslashes safely, so we could allow backslash to escape dollar sign too. Do we want environment variable support only for things that take text (pathnames, filenames, string values), or do we also want it in C expression contexts? If only the former, maybe $ENV(HOME) without the inner quotes; quotes are already special. -- Daniel Jacobowitz CodeSourcery