tools/gdb: Fix gdbinit to unload all nuttxgdb related modules

There are many modules like nuttxgdb.* that we need to unload

Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
This commit is contained in:
Zhe Weng 2024-09-25 19:10:00 +08:00 committed by Xiang Xiao
parent 7d2d38f899
commit 3ad53656b9

View file

@ -30,6 +30,8 @@ if __name__ == "__main__":
sys.path.insert(0, here)
if "nuttxgdb" in sys.modules:
del sys.modules["nuttxgdb"]
for key in list(sys.modules.keys()):
if key.startswith("nuttxgdb"):
del sys.modules[key]
import nuttxgdb # noqa: F401