0

When I start to debug with gdb I edit few breakpoints and commands into gdbinit file.

How can I change this file and load it again while I debugging without detach from process?

Employed Russian
  • 199,314
  • 34
  • 295
  • 362
Kokomelom
  • 143
  • 1
  • 10

1 Answers1

0

How can I change this file and load it again

There is nothing special about this file (other than it's automatically read by GDB at startup) -- it's just a file of GDB commands.

You can reread it with (gdb) source ~/.gdbinit.

Employed Russian
  • 199,314
  • 34
  • 295
  • 362
  • But this only add the breakpoints and commands that into new source file. It doesn't delete all the breakpoints and commands that were into old file – Kokomelom Nov 08 '21 at 06:23
  • @Kokomelom You didn't _ask_ to dele all the old breakpoints. There is "reset everything to defaults" command (AFAICT), you have to do it manually. E.g. `delete breakpoints` will delete all current breakpoints. – Employed Russian Nov 08 '21 at 14:47
  • @Kokomelom You can of course put `delete breakpoints` as the first line of `~/.gdbinit`, so every time it's (re)loaded you start afresh. – Employed Russian Nov 08 '21 at 16:36