diff --git a/gdbinit.py b/gdbinit.py index e55b99fe5..c864774e7 100644 --- a/gdbinit.py +++ b/gdbinit.py @@ -162,6 +162,16 @@ def init_logger(): def main() -> None: + if "pwndbg" in sys.modules: + print( + "Detected double-loading of Pwndbg (likely from both .gdbinit and the Pwndbg portable build)." + ) + print( + "To fix this, please remove the line 'source your-path/gdbinit.py' from your .gdbinit file." + ) + sys.stdout.flush() + os._exit(1) + profiler = cProfile.Profile() start_time = None diff --git a/lldbinit.py b/lldbinit.py index 94698511c..f9fcb31fa 100644 --- a/lldbinit.py +++ b/lldbinit.py @@ -125,6 +125,11 @@ def skip_venv(src_root) -> bool: def main(debugger: lldb.SBDebugger, major: int, minor: int, debug: bool = False) -> None: + if "pwndbg" in sys.modules: + print("Detected double-loading of Pwndbg.") + print("This should not happen. Please report this issue if you're not sure how to fix it.") + sys.exit(1) + profiler = cProfile.Profile() start_time = None