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

LuaPanda调试UnLua时,查看TArry时会断开连接。 #62

Closed
lzxcs opened this issue Mar 25, 2020 · 4 comments
Closed

LuaPanda调试UnLua时,查看TArry时会断开连接。 #62

lzxcs opened this issue Mar 25, 2020 · 4 comments

Comments

@lzxcs
Copy link

lzxcs commented Mar 25, 2020

环境:UE4 + VSCode + LuaPanda
问题:调试UnLua时,查看C++的TArry时会断开连接,并且无法查看TArry的值。

1.我用了原版Unlua进行测试https://github.com/Tencent/UnLua
2.增加了LuaSocket库,然后在TPSCharacter.cpp里新增了一个:
UPROPERTY(BlueprintReadOnly)
TArray TestArray;
3.在BP_PlayerCharacter_C.lua中增加对TestArray存取操作,然后断点打在存取操作上。
4.开始调试,运行UE4 PIE,然后断住,尝试悬停查看TestArray数值。
5.据异常抛出应该是:
LogUnLua: Error: [Plugins/UnLua/Source/UnLua/Private/LuaCore.cpp:2647] Lua error message: [string "Common/LuaPanda.lua"]:2344: '__index' chain too long; possible loop
stack traceback:
[string "Common/LuaPanda.lua"]:2344: in function 'Common/LuaPanda.getVariableRef'
[string "Common/LuaPanda.lua"]:963: in function 'Common/LuaPanda.dataProcess'
[string "Common/LuaPanda.lua"]:1288: in function 'Common/LuaPanda.receiveMessage'
[string "Common/LuaPanda.lua"]:1331: in function 'Common/LuaPanda.debugger_wait_msg'
[string "Common/LuaPanda.lua"]:1142: in function 'Common/LuaPanda.dataProcess'
[string "Common/LuaPanda.lua"]:1288: in function 'Common/LuaPanda.receiveMessage'
[string "Common/LuaPanda.lua"]:1331: in function 'Common/LuaPanda.debugger_wait_msg'
[string "Common/LuaPanda.lua"]:999: in function 'Common/LuaPanda.dataProcess'
[string "Common/LuaPanda.lua"]:1288: in function 'Common/LuaPanda.receiveMessage'
[string "Common/LuaPanda.lua"]:1331: in function 'Common/LuaPanda.debugger_wait_msg'
...
[string "Common/LuaPanda.lua"]:999: in function 'Common/LuaPanda.dataProcess'
[string "Common/LuaPanda.lua"]:1288: in function 'Common/LuaPanda.receiveMessage'
[string "Common/LuaPanda.lua"]:1331: in function 'Common/LuaPanda.debugger_wait_msg'
[string "Common/LuaPanda.lua"]:1900: in function 'Common/LuaPanda.SendMsgWithStack'
[string "Common/LuaPanda.lua"]:1804: in function 'Common/LuaPanda.real_hook_process'
[string "Common/LuaPanda.lua"]:1710: in function 'Common/LuaPanda.debug_hook'

@stuartwang
Copy link
Collaborator

收到,我们最近会看一下

@lzxcs
Copy link
Author

lzxcs commented Mar 26, 2020

更正一下,实际异常抛出是在LuaCore.cpp 的 int32 ReportLuaCallError(lua_State *L) 方法的if (Type == LUA_TSTRING)这个判断内

@lzxcs
Copy link
Author

lzxcs commented Apr 27, 2020

有个临时解决方案:详见#64 (comment)

@lzxcs lzxcs closed this as completed Apr 27, 2020
@stuartwang
Copy link
Collaborator

非常感谢,我会测试一下然后整理成文档方便大家看到

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