6

I have set up my ~/.gdbinit with some commands for a specific configuration.

Sometimes I would like to start gdb to ignore the .gdbinit.

Is there a mechanism to ignore .gdbinit or override it by another .gdbinit?

Krischu
  • 1,024
  • 2
  • 15
  • 35

2 Answers2

11

Run GDB with

gdb -nx

This skips the .gdbinit file processing.

j6t
  • 9,150
  • 1
  • 15
  • 35
2

According to GDB docs, Initialization Files You want to skip your "Home directory early initialization files", to do so start GDB with -nh.

The accepted answer -nx also disables the "System wide initialization files" and the "Local directory initialization file".

Simon Sobisch
  • 6,263
  • 1
  • 18
  • 38