-
Notifications
You must be signed in to change notification settings - Fork 146
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
debugger with attach
method does not stop at a breakpoint
#1835
Comments
Try setting this as an environment variable. DEBUG_PYDEVD_PATHS_TRANSLATION=True The pydevd.log should then have more to say about path translation. That's usually the problem with setting breakpoints in source, they don't map to the actual file. |
thanks @rchiodo for the suggestion, but if I had the breakpoint set in the source code via ADD1: The source code file I bind mount to the container, so it is line-by-line compatible. Then I also tried to play with the |
Here is the full pydevd log after adding the env var like this: os.environ["DEBUG_PYDEVD_PATHS_TRANSLATION"] = "True"
debugpy.log_to("/etc/opt/srlinux/")
debugpy.listen(("0.0.0.0", 55678))
debugpy.wait_for_client() https://gist.github.com/hellt/c22eebcb69c9fe6a0558b1ed3c6dd150 |
I don't see the debuggee getting the breakpoints request. There should be something like this in the pydevd.log
|
Could it be because of this in the beginning of the log?
|
Sorry, I think the breakpoints got wiped after I recreated the environment. I have opened the log on one side and monitored it while I am adding a breakpoint in the UI Here is the full log https://gist.github.com/hellt/077be35d958d75ecc408e5cb3b272805 The request is on ln 1756 |
That dlopen exception is handled, but it might be on attach we can't turn on sys.trace without that dll. I wasn't sure that was the case, but it explains your situation. If we can't trace the functions with the breakpoints in them, the breakpoints will never get hit. I assume the remote machine is ARM64? Can you try this same thing with python 3.13 instead? We use a different method for injecting the trace in 3.12 and above. |
I don't control the python env, so can't switch from py 3.11. |
@rchiodo repeated on the amd64 system in the same environment. The dlopen exception is no more, the paths look accurate, but still no breakpoint action. https://gist.github.com/hellt/428e35d11fb0d485bb0439ad51d02988 |
Are you sure you're hitting the code with the breakpoint in it? You have a breakpoint in a file called uptime.py. I never see a trace that goes through that file. Lines like this:
In fact, I never see tracing of anything in this directory:
How is the code for your plugin being loaded in the remote machine? |
Good call... I think maybe the dynamic nature of the way my file is loaded causes these issues... My py skills are not meeting the requirement to understand the loader code, but maybe indeed it loads the plugin in mem so that the original file is never actually called... |
I think it's loaded here:
Not sure if you own the plugin code or not, but if that was changed to exec a code object, it might work. Something like so: code_object = compile(source, self.path, 'exec')
exec(code_object, globals(), globals()) I believe the code-object is still tied to its original file, but you'd have to try it to be sure. |
yes, I can control and edit the loader src code, will try this. Thanks for the hint, appreciate! I'll post the results when I get them. |
Oh wow, that worked on amd64. Thanks a lot @rchiodo, you are the best! |
Yay! Glad I could help. |
Environment data
Actual behavior
I need to debug a remote python process (CLI). To do so, I have the following configuration:
In the CLI plugin code that I need to debug I install the following:
Then later in the plugin code I set a breakpoint with
breakpoint()
.I can successfully connect to the DAP and see some threads in the callstack:
But my breakpoint never triggers the debugger...
In the
debugpy.server
log I see:In the pydev.d I see many of:
In the adapter log I see the breakpoints from the UI correctly verified:
Expected behavior
Debugger stops at a breakpoint
The text was updated successfully, but these errors were encountered: