Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ notebook attached to IPyIDA. The command takes care of installing dependencies
on its first run and starting a Notebook server unless one is already running.
Check the command help (by typing `%open_notebook?`) for further options.

Both `notebook` 6.x and 7.x are supported. On 7.x (which is served by
`jupyter-server`) IPyIDA pre-creates a kernel session against the `proxy`
kernel via the REST API so the JupyterLab-based frontend attaches to it on
load — the legacy `?kernel_name=` query string alone is not honoured on the
new UI.

== Customizing the IPython console

By default, the console does not have any globals available. If you want to
Expand Down
19 changes: 19 additions & 0 deletions ipyida/kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,23 @@ def is_using_ipykernel_5():
import ipykernel
return hasattr(ipykernel.kernelbase.Kernel, "process_one")


def _configure_debugpy_python():
# ipykernel's Debugger drives debugpy.listen(), which spawns its DAP
# adapter via sys.executable. In IDA that's idaq.exe, so the adapter
# never starts and listen() hits its 30 s accept() timeout -- this is
# what makes the JupyterLab/Notebook 7 debug button hang then error
# with "timed out waiting for adapter to connect". Point debugpy at
# the real interpreter backing this environment.
try:
import debugpy
from .notebook import _python_executable
except ImportError:
return
python = _python_executable()
if os.path.exists(python):
debugpy.configure(python=python)

def get_ea_bounds():
"""
Wraps getting the min and max ea to use either inf_get_min_ea
Expand Down Expand Up @@ -166,6 +183,8 @@ def start(self):

self.connection_file = app.connection_file

_configure_debugpy_python()

if not is_using_ipykernel_5():
app.kernel.do_one_iteration()

Expand Down
Loading