This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] usage of environment variable from the command line


On Mon, Sep 24, 2007 at 09:43:54AM -0700, Jim Blandy wrote:
> I think we want it in both places.  In general, the syntax for
> substituting such variables into source-language expressions would
> need to be language-specific to avoid changing the meaning of any
> normal expression.  So that would need to be done on a
> language-by-language basis.
> 
> For the other cases, this is bikesheddy of me, but why not simply
> ${HOME}, braces required?

I don't want to use something as generic as ${} for Unix environment
variables, because we might want a more general expansion.

Why not define ${...}, or something similar, to do textual expansion
before the language parsers get to it?  Then I also have a patch I
can submit to let us define string variables more usefully; we can
substitute them in without quotes in this context, and so use them
for filenames.

If we pick the syntax cleverly we can use it to call scripting
language functions too.  Although sometimes I'd want those to produce
GDB "struct value" rather than a text string, so we'd still need
both...

Yes, there's lots of quoting issues doing it this way.  I'd want a
more formal specification of when this expansion happened and what it
produced before we did it.  It should probably be specific to the CLI
interpreter and not happen to MI input (excluding interpreter-exec of
course).

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]