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

Debugging generated functions #24

Open
YingboMa opened this issue Jan 16, 2021 · 6 comments
Open

Debugging generated functions #24

YingboMa opened this issue Jan 16, 2021 · 6 comments

Comments

@YingboMa
Copy link
Member

@ChrisRackauckas mentioned that to get a nice stack trace from generated functions, we can print the expression into a temporary file and point the stack trace to that file.

Can this be done automatically with Ctrl - Q functionality in the REPL and other IDEs?

CC: @pfitzseb, @c42f

@pfitzseb
Copy link

pfitzseb commented Jan 16, 2021

I feel like I'm missing some context here :) Can't you just insert LNNs to where the expression is defined or something?

@ChrisRackauckas
Copy link
Member

There is no file in which the function exists because it's a runtime generated object. Think of SymPy generating a function and then that function errors: how do you show the code that errored to the user?

@pfitzseb
Copy link

Ok, I was just going by the example in the readme. Makes sense that that doesn't reflect real usecases though.

It should be fairly easy to support the Ctrl-Q case by overwriting the handler for that and inserting a special marker for RGFs. Generating a clickable link seems impossible without writing a file containing the expr at definition time, which seems like a bad idea.

@ChrisRackauckas
Copy link
Member

If we can overload the stacktrace function, we can inject code so that the RuntimeGeneratedFunction can save out a stream to a temporary file and point to that file?

@wangyunyueyueniao
Copy link

Any updates now?

@ChrisRackauckas
Copy link
Member

It hasn't. We know what we want to do, but not how to implement it.

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

4 participants