0

I use GDB very often to debug my C-program and I use the print options like :

  1. set print pretty on
  2. set print array-index on

But at moment I need to set these print options everytime I open a new GDB session. I am looking for a way such that I can set these print options once forever so that print options are set in every new GDB session.

thanks

Robin Sharma
  • 181
  • 2
  • 11
  • 2
    Give a look here: https://stackoverflow.com/questions/2045509/how-to-save-settings-in-gdb – ieio May 16 '19 at 12:04

1 Answers1

1

You probably want to use a gdbinit file on your home directory.

 ~/.gdbinit

See: gdbinit manpage

From the manpage:

These files contain GDB commands to automatically execute during GDB startup

mgagnon
  • 314
  • 1
  • 4
  • 10