System-wide configuration (Debugging with ROCGDB)

Previous: Configure Options, Up: Installing GDB [Contents][Index]

### C.6 System-wide configuration and settings

ROCGDB can be configured to have a system-wide init file and a system-wide init file directory; this file and files in that directory (if they have a recognized file extension) will be read and executed at startup (see What ROCGDB does during startup).

Here are the corresponding configure options:

`--with-system-gdbinit=file`

  Specify that the default location of the system-wide init file is file.

`--with-system-gdbinit-dir=directory`

  Specify that the default location of the system-wide init file directory is directory.

If ROCGDB has been configured with the option `--prefix=$prefix`, they may be subject to relocation. Two possible cases:

- If the default location of this init file/directory contains `$prefix`, it will be subject to relocation. Suppose that the configure options are `--prefix=$prefix --with-system-gdbinit=$prefix/etc/gdbinit`; if ROCGDB is moved from `$prefix` to `$install`, the system init file is looked for as `$install/etc/gdbinit` instead of `$prefix/etc/gdbinit`.
- By contrast, if the default location does not contain the prefix, it will not be relocated. E.g. if ROCGDB has been configured with `--prefix=/usr/local --with-system-gdbinit=/usr/share/gdb/gdbinit`, then ROCGDB will always look for `/usr/share/gdb/gdbinit`, wherever ROCGDB is installed.

If the configured location of the system-wide init file (as given by the `--with-system-gdbinit` option at configure time) is in the data-directory (as specified by `--with-gdb-datadir` at configure time) or in one of its subdirectories, then ROCGDB will look for the system-wide init file in the directory specified by the `--data-directory` command-line option. Note that the system-wide init file is only read once, during ROCGDB initialization. If the data-directory is changed after ROCGDB has started with the `set data-directory` command, the file will not be reread.

This applies similarly to the system-wide directory specified in `--with-system-gdbinit-dir`.

Any supported scripting language can be used for these init files, as long as the file extension matches the scripting language. To be interpreted as regular ROCGDB commands, the files needs to have a `.gdb` extension.

Previous: Configure Options, Up: Installing GDB [Contents][Index]