Hook on module names #1872
Replies: 3 comments 1 reply
-
Changing to a discussion item, not an issue |
Beta Was this translation helpful? Give feedback.
-
No sorry, debugpy is not organized like pdb is.
This file here maps remote paths to client paths, that is likely where you'd make a modification to remove something from the front of file path. https://github.com/microsoft/debugpy/blob/main/src/debugpy/_vendored/pydevd/pydevd_file_utils.py Although have you tried just doing the mapping using the pathMapping setting in the launch.json? Maybe that doesn't work because the |
Beta Was this translation helpful? Give feedback.
-
I've not found a way to update the source mappings list in such a way that it will support this use case. I think the only solution would be too either overwrite the file_utils module or a different solution. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've got a very unique setup. The python process I want sits on a remote server but the modules are retrieved from a tree based structure in a database. So the file parameter of the module object will look like this "[context]/[modulename]". We've got the python files in a local repository and we use pipelines to recon these files with those stored in the database.
So getting to the problem, I can attach to the debugger process perfectly well but the module names are sending through as "[context]/[modulename]" if I can add a hook in somewhere to remove the [context] then our team's pycharm/vscode will be able to pick up the file being debugged.
Before I do a deep dive into the debugpy codebase I think some advice would save me a lot of time. Can I provide a custom Pdb class for the debugger? Is there a natural point in debugpy where I could insert such a hook?
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions