0

(gdb) source script.py loaded script file to GDB

How to unload that script? How to unload all loaded script or view all script that loaded ?

user13145920
  • 179
  • 1
  • 9

2 Answers2

1

How to unload that script? How to unload all loaded script or view all script that loaded ?

Think of (gdb) prompt as a shell. You can't "unload" a script anymore than you can "untype" a command you type into the shell:

$ FOO="bar"
$ source script.sh

Neither of above commands can be "unloaded".

If you need to reset the state of shell or gdb, start a new instance of it.

Employed Russian
  • 199,314
  • 34
  • 295
  • 362
0

The script is "sourced", not "loaded". The script executed and exited. Hence you can't unload it. It may have left something after itself (pretty-printers, commands, breakpoints, changes in configuration etc). You can't unload them all as a group, you have to find them and undo one-by-one.