My experiments show that $HOME/.gdbinit is discovered. I actually changed the $HOME env variable:)
However, I hit
warning: not using untrusted file "/v/global/user/b/bi/bint/.gdbinit"
, even though I added q(gdb -iex ‘set auto-load safe-path …’). I guess the warning come up before the -iex option takes effect
gdb -ix '/path/to/.gdbinit' # also failed due to untrusted file g++ -std=c++0x -g dump.cpp && gdb -iex 'add-auto-load-safe-path .' ./a.out # working