Cirn09/idavscode

redirect output not work after reopen idb when ipyida also installed

Cirn09 opened this issue · 0 comments

WHAT

Open an idb, debug, then close, final reopen.
Now idavscode's redirect output would not work (no output in vscode "DEBUG CONSOLE")

WHY

some plugin ( like ipyida ) hooked Python's stdout (stderr).

when close idb, plugin will unload, ipyida will remove hook; And plugin will reload when idb reopen, ipyida will re-install hook.

And debugpy also need hook stdout to achieve redirect output.
Currently we have no way to stop debugpy, so I set idavscode will not unload when idb closed.
so:

# first open idb
debugpy.stdout -> ipyida.stdout -> IDAPython.stdout

# after reopen
debugpy.stdout -> old ipyida.stdout
                  new ipyida.stdout -> IDAPython.stdout

How to fix

wait for debugpy's stop api: microsoft/debugpy#870
or set ipyida also not unload when idb close.