This is the mail archive of the
mailing list for the GDB project.
Re: [RFA]: Initialize solib search psth from environ variable
- To: Michael Snyder <msnyder at cygnus dot com>
- Subject: Re: [RFA]: Initialize solib search psth from environ variable
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Wed, 01 Nov 2000 11:36:48 +1100
- Cc: gdb-patches at sources dot redhat dot com
- References: <200010312209.OAA25598@cleaver.cygnus.com>
Michael Snyder wrote:
> This patch would check the environment variables SOLIB_SEARCH_PATH
> and SOLIB_ABSOLUTE_PREFIX once, at start-up, and use them to set the
> corresponding gdb state variables.
> 2000-10-31 Michael Snyder <email@example.com>
> * solib.c (initialize_solib): Initialize solib_absolute_prefix
> and solib_search_path from the environment variables
> SOLIB_ABSOLUTE_PREFIX and SOLIB_SEARCH_PATH, if they're defined.
As it currently stands, I don't like this patch. It introduces (more)
obscure undocumented behavour into GDB and its CLI.
I think there first needs to be a clear policy on the question of should
a GDB (native or cross) take information from the host environment (1).
Then, if the decision is yes, a clearly documented convention on how to
implement this behavour (nameing convention, semantics, ...).
My personal preference is to not add this feature. I think that
.gdbinit files and explicit command line options/commands would be more
useful. Having GDB silently pick things up from a host environment
(especially in a test situtation) will just make things more confusing.
(1) I should note that a native GDB does take environment-variables from
the ``target'' environment. It is just that, in a native situtation,
the distinction between host and target gets pretty blured.
> Index: solib.c
> RCS file: /cvs/cvsfiles/devo/gdb/solib.c,v
> retrieving revision 1.155
> diff -c -3 -p -r1.155 solib.c
> *** solib.c 2000/10/31 22:04:12 1.155
> --- solib.c 2000/10/31 22:08:17
> *************** This takes precedence over the environme
> *** 810,813 ****
> --- 810,819 ----
> + /* check for solib path environment variables */
> + if ((tmp = getenv ("SOLIB_ABSOLUTE_PREFIX")) != NULL)
> + solib_absolute_prefix = strsave (tmp);
> + if ((tmp = getenv ("SOLIB_SEARCH_PATH")) != NULL)
> + solib_search_path = strsave (tmp);