Initialization files¶
At startup, UDB executes several initialization files, that is text files containing a series of UDB
commands.
In these files, comments (lines starting with #
) and blank lines are ignored.
UDB tries to execute UDB-specific initialization files first but, if one doesn’t exist, UDB falls back to executing a corresponding GDB initialization file. This way, UDB automatically picks up any existing configuration for GDB.
UDB executes the following initialization files (in the specified order):
System-wide initialization files
/etc/udbinit
/etc/gdbinit
(only if/etc/udbinit
doesn’t exist)
The above files are not executed if the
-nx
option is passed to UDB.Home-directory initialization files
~/.udbinit
~/.gdbinit
(only if~/.udbinit
doesn’t exist)
The above files are not executed if the
-nx
or-nh
options are passed to UDB.Local initialization files (current directory)
./.udbinit
./.gdbinit
(only if./.udbinit
doesn’t exist)
The above files are not executed if the
-nx
option is passed to UDB.If the current directory is the home directory, then initialization files are not executed for a second time.
For security reasons, UDB only loads files from the current directory if the path is explicitly marked as safe by the user. To enable the execution of a single file, add this line to a system-wide or home-directory initialization file, for instance
~/.udbinit
:add-auto-load-safe-path <PATH-TO-LOCAL-INITIALIZATION-FILE>
To enable the execution of any file in a directory and its descendants, add:
add-auto-load-safe-path <TRUSTED-DIRECTORY-PATH>
To completely disable this security protection, add:
set auto-load safe-path /
Interaction with command-line options¶
UDB processes initialization files and command-line options in the following order:
System-wide initialization files are executed.
Home-directory initialization files are executed.
The
--init-eval-command
/-iex
and--init-command
/-ix
options are handled in the order they were passed on the command line.The inferior (that is, the program or Undo recording) passed on the command line, if any, is loaded.
Local initialization files are executed.
The
--eval-command
/-ex
and--command
/-x
options are handled in the order they were passed on the command line.