在 SIGILL 处理程序中,如何跳过有问题的指令?
我要生成 JIT 代码,并且想将无效的操作码插入流中以执行一些元调试。一切都很好,直到它到达指令,此时,事情进入非法指令到信号处理程序并返回的无限循环。
有什么方法可以设置它来简单地跳过错误的指令吗?
I'm going JIT code generation, and I want to insert invalid opcodes into the stream in order to perform some meta-debugging. Everything is fine and good until it hits the instruction, at which point the thing goes into an infinite loop of illegal instruction to signal handler and back.
Is there any way I can set the thing to simply skip the bad instruction?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是非常hacky和不可移植的,但是:
像这样安装
sighandler
:如果你知道要跳过多远,那么可以工作(并且它是Intel进程):-)
It's very hacky and UNPORTABLE but:
install the
sighandler
like that:That could work if you know how far to skip (and it's a Intel proc) :-)
您还可以尝试另一种方法(如果它适用于您的情况):
您可以使用更易于管理的 SIGTRAP。
You can also try another approach (if it applies to your case):
you can use a SIGTRAP which is easier to manage.