Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error attaching trying to attach a debugger #199

Open
Andrej730 opened this issue Jul 14, 2024 · 2 comments
Open

Error attaching trying to attach a debugger #199

Andrej730 opened this issue Jul 14, 2024 · 2 comments

Comments

@Andrej730
Copy link

Maybe I'm getting too much ahead but since Pycharm is the only supported IDE atm I was trying to check if it's possible to use reloadium with some other debugger attached - simple pdb or debugpy.

Since I currently testing it with reloadium run is blocked by #197 for me I was starting it from Pycharm plugin assuming it works similarly to how reloadium run should.

Steps:

  1. Save either one of the examples below
  2. Run with Reloadium from Pycharm
  3. Get Nuitka related traceback.

Is it known limitation or it's a bug?
Could it be fixed? That way it will be possible to make reloadium IDE independent - it would be possible to use it with just pdb.

example1.py

breakpoint()

# Traceback (most recent call last):
#   File "Python311\Lib\pdb.py", line 1696, in set_trace
#     pdb.set_trace(sys._getframe().f_back)
#   File "Python311\Lib\bdb.py", line 332, in set_trace
#     frame.f_trace = self.trace_dispatch
#     ^^^^^^^^^^^^^
# RuntimeError: f_trace is not writable in Nuitka

example2.py

import debugpy
debugpy.listen(5678)
debugpy.wait_for_client()

# Traceback (most recent call last):
#   File "\main.py", line 3, in <module>
#     debugpy.listen(5678)
#   File "\debugpy\public_api.py", line 31, in wrapper
#     return wrapped(*args, **kwargs)
#            ^^^^^^^^^^^^^^^^^^^^^^^^
#   File "\debugpy\server\api.py", line 45, in _settrace
#     return pydevd.settrace(*args, **kwargs)
#            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# RuntimeError: f_trace is not writable in Nuitka

Desktop or remote (please complete the following information):

  • OS: Windows 11 23H2
  • OS version: 23H2
  • M1 chip: no
  • PyCharm plugin version: 1.5.1
  • Editor: PyCharm
  • Python: Python 3.11.9 (tags/v3.11.9:de54cf5, Apr 2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)] on win32
  • Run mode: Run
@dkrystki
Copy link
Contributor

Hi @Andrej730
Only pydevd based debuggers are compatible with Reloadium.
Debugpy is pydevd based so it's possible to implement support for it and I've been planning to do it for some time but haven't found bandwidth for it yet.
Regarding pdb - what's your use case here?

@Andrej730
Copy link
Author

Regarding pdb - what's your use case here?

Same as with debugpy - to use it as an option to make reloadium work in debug mode without PyCharm.
In case of debugpy it would be possible to attach to it with VS Code and debug it.
With pdb - it would be possible to debug something without any IDE at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants