GDB (xrefs)

Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
gdb_environ Class Reference

`#include "environ.h"`

## Public Member Functions
| gdb_environ ()
| ~gdb_environ ()
| gdb_environ (gdb_environ &&e)
gdb_environ & | operator= (gdb_environ &&e)
void | clear ()
const char * | get (const char *var) const
void | set (const char *var, const char *value)
void | unset (const char *var)
char ** | envp () const
const std::set< std::string > & | user_set_env () const
const std::set< std::string > & | user_unset_env () const

## Static Public Member Functions
static gdb_environ | from_host_environ ()

## Private Member Functions
void | unset (const char *var, bool update_unset_list)

## Private Attributes
std::vector< char * > | m_environ_vector
std::set< std::string > | m_user_set_env
std::set< std::string > | m_user_unset_env

## Detailed Description

Definition at line 26 of file environ.h.

## Constructor & Destructor Documentation

## ◆ gdb_environ() [1/2]

gdb_environ::gdb_environ | ( |  | ) |
| inline

Definition at line 30 of file environ.h.

References m_environ_vector.

## ◆ ~gdb_environ()

gdb_environ::~gdb_environ | ( |  | ) |
| inline

Definition at line 38 of file environ.h.

References clear().

## ◆ gdb_environ() [2/2]

gdb_environ::gdb_environ | ( | gdb_environ && | e | ) |
| inline

Definition at line 44 of file environ.h.

## Member Function Documentation

## ◆ clear()

void gdb_environ::clear | ( |  | ) |

Definition at line 65 of file environ.c.

References m_environ_vector, m_user_set_env, m_user_unset_env, and xfree().

Referenced by selftests::gdb_environ_tests::test_vector_clear(), unset_environment_command(), and ~gdb_environ().

## ◆ envp()

char ** gdb_environ::envp | ( |  | ) | const

Definition at line 166 of file environ.c.

References m_environ_vector.

Referenced by environment_info(), selftests::gdb_environ_tests::test_move_constructor(), selftests::gdb_environ_tests::test_reinit_from_host_environ(), selftests::gdb_environ_tests::test_std_move(), selftests::gdb_environ_tests::test_unset_set_empty_vector(), selftests::gdb_environ_tests::test_vector_clear(), and selftests::gdb_environ_tests::test_vector_initialization().

## ◆ from_host_environ()

gdb_environ gdb_environ::from_host_environ | ( |  | ) |
| static

Definition at line 44 of file environ.c.

References environ, and m_environ_vector.

Referenced by selftests::gdb_environ_tests::test_init_from_host_environ(), selftests::gdb_environ_tests::test_reinit_from_host_environ(), and selftests::gdb_environ_tests::test_set_unset_reset().

## ◆ get()

const char * gdb_environ::get | ( | const char * | var | ) | const

Definition at line 92 of file environ.c.

References m_environ_vector, and match_var_in_string().

Referenced by environment_info(), mi_cmd_env_path(), path_command(), selftests::gdb_environ_tests::test_init_from_host_environ(), selftests::gdb_environ_tests::test_move_constructor(), selftests::gdb_environ_tests::test_self_move(), selftests::gdb_environ_tests::test_set_A_unset_B_unset_A_cannot_find_A_can_find_B(), selftests::gdb_environ_tests::test_set_unset_reset(), selftests::gdb_environ_tests::test_std_move(), selftests::gdb_environ_tests::test_unset_set_empty_vector(), selftests::gdb_environ_tests::test_vector_clear(), and selftests::gdb_environ_tests::test_vector_initialization().

## ◆ operator=()

gdb_environ & gdb_environ::operator= | ( | gdb_environ && | e | ) |

Definition at line 26 of file environ.c.

References m_environ_vector, m_user_set_env, and m_user_unset_env.

## ◆ set()

void gdb_environ::set | ( | const char * | var,
|  | const char * | value
| ) |  |

Definition at line 106 of file environ.c.

References m_environ_vector, m_user_set_env, m_user_unset_env, string, and unset().

Referenced by mi_cmd_env_path(), path_command(), set_environment_command(), selftests::gdb_environ_tests::test_move_constructor(), selftests::gdb_environ_tests::test_self_move(), selftests::gdb_environ_tests::test_set_A_unset_B_unset_A_cannot_find_A_can_find_B(), selftests::gdb_environ_tests::test_set_unset_reset(), selftests::gdb_environ_tests::test_std_move(), selftests::gdb_environ_tests::test_unset_set_empty_vector(), and selftests::gdb_environ_tests::test_vector_clear().

## ◆ unset() [1/2]

void gdb_environ::unset | ( | const char * | var | ) |

Definition at line 158 of file environ.c.

Referenced by set(), selftests::gdb_environ_tests::test_set_A_unset_B_unset_A_cannot_find_A_can_find_B(), selftests::gdb_environ_tests::test_set_unset_reset(), selftests::gdb_environ_tests::test_unset_set_empty_vector(), and unset_environment_command().

## ◆ unset() [2/2]

void gdb_environ::unset | ( | const char * | var,
|  | bool | update_unset_list
| ) |  |
| private

Definition at line 130 of file environ.c.

References m_environ_vector, m_user_set_env, m_user_unset_env, match_var_in_string(), string, and xfree().

## ◆ user_set_env()

const std::set< std::string > & gdb_environ::user_set_env | ( |  | ) | const

Definition at line 174 of file environ.c.

References m_user_set_env.

Referenced by extended_remote_environment_support(), selftests::gdb_environ_tests::test_init_from_host_environ(), selftests::gdb_environ_tests::test_move_constructor(), selftests::gdb_environ_tests::test_self_move(), selftests::gdb_environ_tests::test_set_A_unset_B_unset_A_cannot_find_A_can_find_B(), selftests::gdb_environ_tests::test_set_unset_reset(), selftests::gdb_environ_tests::test_std_move(), selftests::gdb_environ_tests::test_unset_set_empty_vector(), selftests::gdb_environ_tests::test_vector_clear(), and selftests::gdb_environ_tests::test_vector_initialization().

## ◆ user_unset_env()

const std::set< std::string > & gdb_environ::user_unset_env | ( |  | ) | const

Definition at line 180 of file environ.c.

References m_user_unset_env.

Referenced by extended_remote_environment_support(), selftests::gdb_environ_tests::test_init_from_host_environ(), selftests::gdb_environ_tests::test_set_unset_reset(), selftests::gdb_environ_tests::test_unset_set_empty_vector(), selftests::gdb_environ_tests::test_vector_clear(), and selftests::gdb_environ_tests::test_vector_initialization().

## Member Data Documentation

## ◆ m_environ_vector

std::vector<char *> gdb_environ::m_environ_vector
| private

Definition at line 94 of file environ.h.

Referenced by clear(), envp(), from_host_environ(), gdb_environ(), get(), operator=(), set(), and unset().

## ◆ m_user_set_env

std::set<std::string> gdb_environ::m_user_set_env
| private

Definition at line 97 of file environ.h.

Referenced by clear(), operator=(), set(), unset(), and user_set_env().

## ◆ m_user_unset_env

std::set<std::string> gdb_environ::m_user_unset_env
| private

Definition at line 100 of file environ.h.

Referenced by clear(), operator=(), set(), unset(), and user_unset_env().

The documentation for this class was generated from the following files:

- /tmp/gdb-8.1/gdb/common/environ.h
- /tmp/gdb-8.1/gdb/common/environ.c