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

Support snoop #116

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft

Support snoop #116

wants to merge 12 commits into from

Conversation

winniederidder
Copy link
Contributor

Adds support for Backends to add more run modes (examples can be exec, snoop, birdseye, debug, etc)
Implements the snoop-mode for Python, showing the user a detailed trace of which parts their code visited.
Example output:
snoop

The current layout is quite basic, I'm not sure what style to apply. Maybe a little lighter in color to show it's not regular output (the indent already makes it quite clear)

@alexmojaki
Copy link
Contributor

In futurecoder I use https://github.com/drudru/ansi_up to interpret the ANSI colour codes produced by snoop. For syntax highlighting you could pick a theme from http://help.farbox.com/pygments.html

@winniederidder
Copy link
Contributor Author

Example of possible Snoop output:
snoop

@alexmojaki
Copy link
Contributor

You really need a fixed width font there. Also I suggest setting the filename to /my_program.py.

src/OutputManager.ts Outdated Show resolved Hide resolved
@winniederidder
Copy link
Contributor Author

You really need a fixed width font there. Also I suggest setting the filename to /my_program.py.

The font css was being applied incorrectly, so that's fixed now. The filename is indeed an issue. The problem is to let all libraries find the source file and still displaying it in a nice fashion. I'm not entirely sure how to get that working consistently.

@alexmojaki
Copy link
Contributor

The problem is to let all libraries find the source file and still displaying it in a nice fashion. I'm not entirely sure how to get that working consistently.

Can you explain more? Which libraries are you talking about? What's wrong with filename="/my_program.py" on the python runner? That's what I'm doing.

@winniederidder
Copy link
Contributor Author

winniederidder commented Apr 18, 2022

Can you explain more? Which libraries are you talking about? What's wrong with filename="/my_program.py" on the python runner? That's what I'm doing.

I'm talking about a recent addition to python_runner, being

def set_filename(self, filename):
    self.filename = os.path.normcase(os.path.abspath(filename))

which we did as e.g. Pdb uses this to resolve filenames, whereas other libraries just use relative paths or something similar. So the filename stored is an absolute path, causing it to display like this in other areas too.
We also want to keep the filename dynamic as we do plan to have support for multiple files eventually.

@alexmojaki
Copy link
Contributor

Right, but I'm saying the actual absolute path can be /my_program.py, at the root.

@winniederidder
Copy link
Contributor Author

Right, but I'm saying the actual absolute path can be /my_program.py, at the root.

Oh I see, thanks for this!

@winniederidder winniederidder added deploy This PR should be deployed. and removed deploy This PR should be deployed. labels May 7, 2022
@winniederidder winniederidder temporarily deployed to production May 7, 2022 10:56 Inactive
@winniederidder winniederidder temporarily deployed to production May 7, 2022 15:23 Inactive
@winniederidder winniederidder temporarily deployed to production May 7, 2022 20:17 Inactive
@winniederidder winniederidder added this to the later milestone May 9, 2022
@alexmojaki
Copy link
Contributor

What happened to this? 😢

@winniederidder
Copy link
Contributor Author

What happened to this? 😢

While this PR is functional, we decided to postpone providing debuggers in Papyros to ensure we offer functionality that users can and will use. A separate thesis might cover this in the futrue, at which point this PR might be bought back to life.

@bmesuere bmesuere marked this pull request as draft June 30, 2022 07:04
@bmesuere bmesuere removed their request for review January 15, 2023 16:17
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

Successfully merging this pull request may close these issues.

2 participants