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

Python pdb #33

Open
jcocovich opened this issue Oct 12, 2023 · 4 comments
Open

Python pdb #33

jcocovich opened this issue Oct 12, 2023 · 4 comments

Comments

@jcocovich
Copy link

I cannot seem to get the python debugger to play nice with your API. When the program reaches the trace command, it locks up presumably waiting somewhere for input. Can the interface be made bi-directional and not just write to the log window?

@mackorone
Copy link
Owner

Can the interface be made bi-directional and not just write to the log window?

Yes, but it'd be a fair amount of work, and I won't have time to do it for at least a few months. I'll leave this issue open until I (hopefully) eventually get around to it. Or someone else could take a stab at it if they want :).

@mackorone
Copy link
Owner

In the meantime, you could probably write a proxy program that sits in between the Python client library and the simulator. The proxy could run your algorithm and forward messages to-and-from the simulator, and it could also read input from the user via, e.g., a file.

@jcocovich
Copy link
Author

Is that sort of what the arduino proxy program that intercepts API calls does. Perhaps I could write one for my python script using pdb but sending messages to the proxy. Is that right?

@mackorone
Copy link
Owner

...sort of what the arduino proxy program that intercepts API calls does

Yea, the general idea is to extend the functionality of the simulator by writing a wrapper program that does what you need it to. In your case, it sounds like the proxy program should:

  1. Relay commands from your program to the simulator
  2. Relay responses from the simulator to the program
  3. Relay commands from the user (you) to your program, for the sake of interacting with the debugger

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