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

Putting breakpoints in files outside of a Python SAM App causes "pydev debugger: warning: trying to add breakpoint to file that does not exist" #452

Open
awschristou opened this issue Apr 3, 2019 · 2 comments
Labels
feature-request New feature or enhancement. May require GitHub community feedback. language:python Issues related to debugging Python lambdas using SAM Local sam ux user experience

Comments

@awschristou
Copy link
Contributor

If you debug a Python SAM App, but have breakpoints set on other applications/code within your VS Code workspace folder that isn't in the scope (CodeUri) of the App being debugged, warnings like this appear in the output:

Waiting for debugger to attach...
pydev debugger: warning: trying to add breakpoint to file that does not exist: /var/task/C:/code/sam-apps/js-app/hello-world/app.js (will have no effect)
pydev debugger: warning: trying to add breakpoint to file that does not exist: /var/task/C:/code/sam-apps/other-py-app/hello_world/app.py (will have no effect)
...debugger attached

We should try to create a "clean" debugging experience for the lambda function that is being debugged locally, without impacting any of the user's other settings (like removing breakpoints)

Acceptance Criteria:

  • no warnings about other breakpoints
  • user doesn't lose any other breakpoints they may have set
@awschristou awschristou added feature-request New feature or enhancement. May require GitHub community feedback. language:python Issues related to debugging Python lambdas using SAM Local needs-design labels Apr 3, 2019
@awschristou
Copy link
Contributor Author

awschristou commented Apr 3, 2019

Something we might be able to do:

  • detect when debug sessions start (vscode.debug.onDidStartDebugSession / onDidChangeActiveDebugSession / ...)
  • if debug session is a python session that was started by the toolkit, iterate the current breakpoints (vscode.debug.breakpoints)
    • for each breakpoint not relevant to the codeuri location of the debug session,
      • remove breakpoint (vscode.debug.removeBreakpoints)
      • re-add the breakpoints, but in a disabled state (vscode.debug.addBreakpoints)
      • store the breakpoints somewhere (global/workspace state)
  • detect when debug session ends (onDidTerminateDebugSession / onDidChangeActiveDebugSession)
  • restore the disabled breakpoints from global state

@awschristou awschristou changed the title pydev debugger: warning: trying to add breakpoint to file that does not exist Putting breakpoints in files outside of a Python SAM App causes pydev debugger: warning: trying to add breakpoint to file that does not exist Apr 11, 2019
@awschristou awschristou changed the title Putting breakpoints in files outside of a Python SAM App causes pydev debugger: warning: trying to add breakpoint to file that does not exist Putting breakpoints in files outside of a Python SAM App causes "pydev debugger: warning: trying to add breakpoint to file that does not exist" Apr 11, 2019
@mpiroc mpiroc added the ux user experience label Apr 19, 2019
@justinmk3
Copy link
Contributor

confirmed in 1.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or enhancement. May require GitHub community feedback. language:python Issues related to debugging Python lambdas using SAM Local sam ux user experience
Projects
None yet
Development

No branches or pull requests

3 participants