NULL, or the name of the variable to display. */
static void
-display_environment (const gdb_environ &env, const char *var)
+display_environment (const gdb_environ *env, const char *var)
{
if (var)
{
- const char *val = env.get (var);
+ const char *val = env->get (var);
if (val)
{
}
else
{
- char **envp = env.envp ();
+ char **envp = env->envp ();
for (int idx = 0; envp[idx] != nullptr; ++idx)
{
static void
environment_info (const char *var, int from_tty)
{
- display_environment (current_inferior ()->environment, var);
+ display_environment (¤t_inferior ()->environment, var);
}
/* A helper to set an environment variable. ARG is the string passed
the environment in which the variable will be set. */
static void
-set_var_in_environment (gdb_environ &env, const char *arg)
+set_var_in_environment (gdb_environ *env, const char *arg)
{
const char *p, *val;
int nullset = 0;
gdb_printf (_("Setting environment variable "
"\"%s\" to null value.\n"),
var.c_str ());
- env.set (var.c_str (), "");
+ env->set (var.c_str (), "");
}
else
- env.set (var.c_str (), val);
+ env->set (var.c_str (), val);
}
static void
set_environment_command (const char *arg, int from_tty)
{
- set_var_in_environment (current_inferior ()->environment, arg);
+ set_var_in_environment (¤t_inferior ()->environment, arg);
}
/* A helper to unset an environment variable. ENV is the environment
variable, or NULL meaning unset all variables. */
static void
-unset_var_in_environment (gdb_environ &env, const char *var, int from_tty)
+unset_var_in_environment (gdb_environ *env, const char *var, int from_tty)
{
if (var == 0)
{
/* If there is no argument, delete all environment variables.
Ask for confirmation if reading from the terminal. */
if (!from_tty || query (_("Delete all environment variables? ")))
- env.clear ();
+ env->clear ();
}
else
- env.unset (var);
+ env->unset (var);
}
static void
unset_environment_command (const char *var, int from_tty)
{
- unset_var_in_environment (current_inferior ()->environment, var, from_tty);
+ unset_var_in_environment (¤t_inferior ()->environment, var, from_tty);
}
/* Handle the execution path (PATH variable). */