How to get environment of a program while debugging it in GDB
问题 I am debugging a program in GDB on linux. I am using getenv and setenv calls to read and set environment variables. For example I am calling setenv("TZ", "UTC", 1); to set the TZ environment variable for timezone. To check if the env variable is set I am using GDB command show environment . This prints all the environment variables and their values. But it dose not show TZ being set. Even command show environment TZ says Environment variable "TZ" not defined. Is their another way to check the