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

debug.traceback does not handle coroutines #182

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brandonbloom
Copy link
Contributor

NOTE: Pull request is broken. Only providing the patch for discussion.

See https://www.lua.org/manual/5.1/manual.html#pdf-debug.traceback - The override of debug.traceback in terralib does not respect the thread parameter.

You get something like this:

$ terra

Terra -- A low-level counterpart to Lua

Stanford University
[email protected]

> = debug.traceback(coroutine.running(), 'on noez!', 2)
src/terralib.lua:433: attempt to perform arithmetic on local 'level' (a string value)
stack traceback:
    src/terralib.lua:433: in function <src/terralib.lua:431>

Compare to Lua:

~/Projects/plop $ lua
Lua 5.2.4  Copyright (C) 1994-2015 Lua.org, PUC-Rio
> = debug.traceback(coroutine.running(), 'on noez!', 2)
on noez!
stack traceback:
    [C]: in ?
> ^D

I tried to fix the definition of debug.traceback in terralib, but the obvious solution produced 'error in error handling' for some non-obvious reason. I'll take another look at it soon if you don't have an idea offhand.

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.

1 participant