debugging 如何翻译不可读的WebGL unityWASM stacktrace?

wgeznvg7  于 2023-01-21  发布在  其他
关注(0)|答案(1)|浏览(209)

我在使用Unity Unity 2022.1.24f1和WebGL的生产环境中遇到了一个调试问题。当异常发生时,我得到了一个不可读的堆栈跟踪。如下所示:

Invoking error handler due to
RuntimeError: unreachable
at wasm://wasm/0785b666:wasm-function[985]:0x98818
    at wasm://wasm/0785b666:wasm-function[544]:0x89330
    at wasm://wasm/0785b666:wasm-function[8670]:0x24dccf
    at wasm://wasm/0785b666:wasm-function[1922]:0xbf4e5
    at wasm://wasm/0785b666:wasm-function[28368]:0x812a8b
    at wasm://wasm/0785b666:wasm-function[86902]:0x14c5d3c
    at wasm://wasm/0785b666:wasm-function[557]:0x898ed
    at wasm://wasm/0785b666:wasm-function[77488]:0x1326327
    at wasm://wasm/0785b666:wasm-function[5230]:0x171c41
    at wasm://wasm/0785b666:wasm-function[10658]:0x2feb0d
    at wasm://wasm/0785b666:wasm-function[104320]:0x178c493
    at invoke_iiii (blob:http://localhost:8080/eef1af57-52ea-407d-b414-b8a770143494:3:408461)
    at wasm://wasm/0785b666:wasm-function[2104]:0xc4fc3
    at wasm://wasm/0785b666:wasm-function[24046]:0x7aace3
    at wasm://wasm/0785b666:wasm-function[990]:0x989d5
    at wasm://wasm/0785b666:wasm-function[21506]:0x561c30
    at wasm://wasm/0785b666:wasm-function[51389]:0xd496a6
    at wasm://wasm/0785b666:wasm-function[109425]:0x18f3801
    at wasm://wasm/0785b666:wasm-function[108044]:0x1853d4c
    at wasm://wasm/0785b666:wasm-function[23913]:0x79ec70
    at wasm://wasm/0785b666:wasm-function[23913]:0x79ece1
    at wasm://wasm/0785b666:wasm-function[21361]:0x554206
    at wasm://wasm/0785b666:wasm-function[104316]:0x178c45d
    at browserIterationFunc (blob:http://localhost:8080/eef1af57-52ea-407d-b414-b8a770143494:3:229388)
    at callUserCallback (blob:http://localhost:8080/eef1af57-52ea-407d-b414-b8a770143494:3:182585)
    at Object.runIter (blob:http://localhost:8080/eef1af57-52ea-407d-b414-b8a770143494:3:183845)
    at Browser_mainLoop_runner (blob:http://localhost:8080/eef1af57-52ea-407d-b414-b8a770143494:3:182120)

我无法为生产环境启用调试符号模式,有没有算法可以将此堆栈跟踪转换为真实的的方法名称?
我发现Library\Bee\artifacts\WebGL\il2cppOutput\cpp\Symbols\MethodMap.tsv文件包含我的应用程序中的所有方法名称,但我没有发现这些方法名称/其序列号与stacktrace中的编号之间的任何关系。

slmsl1lt

slmsl1lt1#

tsv包含了c#和c函数之间的关系,这是编译到WASM的第一步,第二步在build目录中创建一个文件. symbols.json(对于Unity 2021和更新版本,在旧版本中它有一个不同的名称)它包含了c和wasm函数之间的关系,但是要得到这个文件,您需要将“发布设置”中的“调试符号”设置为“外部”值。

相关问题