gdbinit, lldbinit: detect and prevent double-loading of pwndbg (#2912)

* gdbinit, lldbinit: detect and prevent double-loading of pwndbg
pull/2913/head
patryk4815 8 months ago committed by GitHub
parent 51e838323d
commit d264a075be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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

@ -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

Loading…
Cancel
Save