Contents

Specifying program arguments, working directory, environment variables

Choose Execution|Arguments to open a dialog where you can set program arguments, the working directory for your program, and environment variables.

Program Arguments

In the top edit box enter the arguments that shall be passed on to your program. Next time the program is started, the new arguments will be used.

Working directory

In the edit box below you can specify the working directory for your program. Your program will use the new directory only when it is run the next time.

The working directory also applies to gdb itself! The directory that you specify will be passed to gdb immediately, i.e. gdb will work with the new setting as soon as you press OK. This can influence whether source code files are found.

Environment variables

In the environment variables section type in an expression of the form VARIABLE=value to set the environment variable VARIABLE to the value value, and click Modify. To remove a variable, select it from the list below and click Remove. To change the value, edit the value in the edit field and click Modify. If you change the name of the variable and click Modify, you add a new variable! The new environment variables will be used by your program the next time it is run.

An important environment variable to set if you are using glibc2 on Linux is LD_BIND_NOW. It is very important that you set this variable to 1 for all your debugging sessions. If it is not set, gdb cannot step into and out of system functions that are imported from the shared libc and other libraries.