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

Suggestion - stack traces #216

Open
dmarcuse opened this issue May 8, 2017 · 5 comments
Open

Suggestion - stack traces #216

dmarcuse opened this issue May 8, 2017 · 5 comments

Comments

@dmarcuse
Copy link
Contributor

dmarcuse commented May 8, 2017

It would be helpful to have stack traces as a feature, either built into the shell or as a standalone program. This can be done without the debug API using xpcall and some magic, like so:

Screenshot

It would be easy to add an existing program to the ROM, or add it as a shell feature that can be toggled with the settings API. What do you guys think? I can whip up a PR, I already have the code written.

@dan200
Copy link
Owner

dan200 commented May 8, 2017 via email

@SquidDev
Copy link
Contributor

SquidDev commented May 8, 2017

If Cobalt (#163) gets merged, it should be safe to expose the entire debug library without issue. However, if not, it shouldn't be too hard to expose a limited subset of the library (traceback, some of getinfo).

@dan200
Copy link
Owner

dan200 commented May 8, 2017 via email

@ghost
Copy link

ghost commented May 11, 2017

I'd love to have stack traces in CC. Debugging is so much easier when you can see where the problem actually is.

[REDACTED] exposes debug.traceback() and debug.getinfo(), but hides the rest of debug. I think that could be easily implemented by exposing debug from Java, then in bios.lua, doing:

_G.debug = {traceback = debug.traceback, getinfo = debug.getinfo}

I've done similar things in the various kernels (yes, plural) I've written in various Lua environments.

@dmarcuse
Copy link
Contributor Author

@alexbuzzbee if I remember correctly there were issues with LuaJ and the debug API, which is why it's not available in CC, but the Cobalt PR would fix that. (#163)

ccserver pushed a commit to ccserver/ComputerCraft that referenced this issue Sep 16, 2019
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

3 participants