简体   繁体   English

无法在asmjit中捕获异常

[英]Can't catch exception in asmjit

I'm using asmjit and I came across a problem. 我正在使用asmjit,遇到了一个问题。 When c++ exception being throwed by a function called in generated jit code (x64), it can not be catched even if I do try-catch outside the jit function call, why's that and how can I catch the exception ? 当c ++异常被生成的jit代码(x64)中调用的函数抛出时,即使我在jit函数调用之外进行try-catch也无法捕获该异常,为什么?如何捕获该异常?

The answer of asmjit's author Petr Kobalíček via Email, very helpful: asmjit的作者PetrKobalíček通过电子邮件的回答,非常有帮助:

it highly depends on OS you are targeting. 这很大程度上取决于您要定位的操作系统。 AsmJit doesn't provide any helpers for exception handling, so you need to handle exceptions yourself. AsmJit不提供任何用于异常处理的帮助程序,因此您需要自己处理异常。

If you are on Windows you can check out: https://msdn.microsoft.com/en-us/library/1eyas8tf.aspx 如果您使用的是Windows,则可以签出: https : //msdn.microsoft.com/zh-cn/library/1eyas8tf.aspx

Also, checking other JIT engines like V8 can help you understand how JITted code usually handles exceptions. 另外,检查其他JIT引擎(例如V8)可以帮助您了解JITted代码通常如何处理异常。 On Windows you can install an exception handler for the whole virtual address space JIT code uses, this way you don't have to embed unwind data for each function. 在Windows上,您可以为JIT代码使用的整个虚拟地址空间安装一个异常处理程序,这样就不必为每个函数嵌入展开数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM