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

Question about debugging VOLTTRON (background for VOLTTRON™ Office Hours - 4/28/2023) #3148

Open
kefeimo opened this issue Jan 6, 2024 · 2 comments

Comments

@kefeimo
Copy link
Contributor

kefeimo commented Jan 6, 2024

Background, in the VOLTTRON™ Office Hours - 4/28/2023 (https://www.youtube.com/watch?v=5caMIDeoieo&t=964s) (around: 15:00-20:00) it talks about debugging volttron using vscode. One scenario is when setting debug point at line 435 volttron/platform/main.py, it didn't go to the brakepoint. And the thread issue was mentioned. Could somebody elaborate on that?

@kefeimo
Copy link
Contributor Author

kefeimo commented Jan 6, 2024

Is the launch.py file for this tutorial available somewhere? Especially what is the setup for listener-agent section (around 24:00)?
(edited) found the following screenshot at 26:07
image

@kefeimo kefeimo changed the title Question about debugging VOLTTRON Question about debugging VOLTTRON (background for VOLTTRON™ Office Hours - 4/28/2023 (https://www.youtube.com/watch?v=5caMIDeoieo&t=964s)) Jan 6, 2024
@kefeimo kefeimo changed the title Question about debugging VOLTTRON (background for VOLTTRON™ Office Hours - 4/28/2023 (https://www.youtube.com/watch?v=5caMIDeoieo&t=964s)) Question about debugging VOLTTRON (background for VOLTTRON™ Office Hours - 4/28/2023) Jan 6, 2024
@craig8
Copy link
Contributor

craig8 commented Jan 6, 2024

I am going to assume you mean launch.json file as it is what vs code uses for launching code.. Debugging volttron.platform.main would require you to start the server in the debugger.

The following will let you do the server.

...
          {
            "name": "volttron -vv",
            "type": "python",
            "request": "launch",
            "program": "env/bin/volttron",
            "console": "integratedTerminal",
            "justMyCode": true,
            "args": [
                "-vv"
            ],
            "env": {
                "GEVENT_SUPPORT": "True"
            },
            "cwd": "${workspaceFolder}"
        },
...

The thread issue is weird. Basically it has to do with the GEVENT_SUPPORT=True. That flag allows greenlets to be debugged and have them hit the break points, however it also has the side effect of "Normal threads" not be able to hit break points. At least that is the observed behavior. if you remove the GEVENT_SUPPORT then your normal threads will be able to be hit but your greenlets won't be able to be debugged. I don't think there is any other in-depth discovery of exactly why or how you could do both.

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