pkulchenko / MobDebug

Remote debugger for Lua.
Other
889 stars 192 forks source link

The call stack may not be displayed completely #55

Closed sonyps5201314 closed 3 years ago

sonyps5201314 commented 4 years ago

the next patch file can fix it.

 lualibs/mobdebug/mobdebug.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lualibs/mobdebug/mobdebug.lua b/lualibs/mobdebug/mobdebug.lua
index dc4ea684..efea8f66 100644
--- a/lualibs/mobdebug/mobdebug.lua
+++ b/lualibs/mobdebug/mobdebug.lua
@@ -338,7 +338,7 @@ local function stack(start)
        linemap and linemap(source.currentline, source.source) or source.currentline,
        source.what, source.namewhat, source.short_src},
       vars(i+1)})
-    if source.what == 'main' then break end
+    -- if source.what == 'main' then break end
   end
   return stack
 end

before use it image

after use it image

pkulchenko commented 4 years ago

@sonyps5201314, why do you think the second one is better than the first one? what=="main" if it is the main part of a chunk, so it's outside of any function and can't be anything other than the top of the stack, no?

sonyps5201314 commented 4 years ago

@sonyps5201314, why do you think the second one is better than the first one? what=="main" if it is the main part of a chunk, so it's outside of any function and can't be anything other than the top of the stack, no?

The main part of a chunk just means that it's the outermost code of a new file, and if skip it, we can`t find which file causes the current file to be loaded, maybe this information is important for user, and no these, the user may think it is the top-level code. and no other Lua debugger does this filtering, it may cause confusion among users

pkulchenko commented 4 years ago

Let me think about this.