Hi everyone, I am Chinese, so my english is poor.
I develop a plugin for Unity, is automatic translate c# to js then run js for achive dynamic update like lua. But it had a bug on Windows Phone 8.1, I need debug managed and native code at the same time, but when I choose
then debug, it show
The bug is overflow, it occur in when native layer call managed layer’s bridge return. But the plugin is work fine on Android and IOS!!! So I think the bug is in Windows Phone 8.1 memory management or SpiderMonkey’s Windows Phone 8.1 lib or my native code, but I am not sure, so I need debug at same time.
If I choose managed code or native code to debug, it can run good, but I cannot find problem from debug managed code or native code only, anyone can help me?
我单独调试c代码的时候发现这个bug是在c层调c#层返回的时候,由于堆栈溢出导致写崩。但是这个插件在Android和iOS上运行的很好(目前为止没出现Windows Phone8.1上这种连加载都过不去的情况),我首先可能是由于Windows Phone8.1本身,或者是Spider Monkey的库有问题,但是我用的SpiderMonkey的库,就是从cocos2d-js里拿出来的,唯一不同的是在cocos2d-js里没有c#里的委托,而我的问题,就出现在委托里!如果js里带委托,那么这里就有一个连环调用,c# → 带有委托的js(委托里还需要调c#) → c# → js的委托 → c#,现在问题就出现在调js的委托时,再回调c#就崩溃(我想到这里也会糊涂一会),所以我也怀疑问题出在我的c代码里。