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

Dump locals of C functions #10

Open
devurandom opened this issue Nov 12, 2015 · 1 comment
Open

Dump locals of C functions #10

devurandom opened this issue Nov 12, 2015 · 1 comment

Comments

@devurandom
Copy link

STP currently does not dump locals of C functions. When debugging those written using the Lua C API, it sometimes happens that the stacks looks different from what I expected. In these cases I would love to use STP to tell me about the stack.

The fix is simple:

--- a/src/StackTracePlus.lua
+++ b/src/StackTracePlus.lua
@@ -355,6 +355,7 @@ Stack Traceback
                        local function_name = m_user_known_functions[info.func] or m_known_functions[info.func] or info.name or tostring(info.func)
                        dumper:add_f("(%d) %s C function '%s'\r\n", level_to_show, info.namewhat, function_name)
                        --dumper:add_f("%s%s = C %s\r\n", prefix, name, (m_known_functions[value] and ("function: " .. m_known_functions[value]) or tostring(value)))
+                       dumper:DumpLocals(level)
                elseif info.what == "tail" then
                        --print("tail")
                        --for k,v in pairs(info) do print(k,v, type(v)) end--print(info.namewhat, info.name)
@ignacio
Copy link
Owner

ignacio commented Nov 12, 2015

Locals of C functions? Do you have an example of this change in action?
I don't really understand how would that work.

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