紧凑型7:尝试Catch捕获其职权范围之外的错误 [英] Compact 7: Try Catch catches errors outside its remit

查看:81
本文介绍了紧凑型7:尝试Catch捕获其职权范围之外的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个try catch处理程序,每次都会经常捕获错误,而不会进入它的代码部分。我在开始括号和第一行代码中放入了断点,但抛出异常而没有遇到任何断点。  从e.what()返回的
消息是"Unknown Exception"。

 void MyClass :: OnUpdate(...)
{

try {//不会遇到断点
... //不会进入这里
}
catch(std :: exception& e)
{
... //直接进入这里
}
}


知道为什么会发生这种情况吗?


CLight

解决方案

可以你在汇编中调试?我的猜测是,在命中断点之前,在try {}块中创建和/或初始化了一个或多个自动变量。该过程是异常的原因。你可能有一个堆栈问题,'这个'可能是你在执行方法时被另一个线程删除的


Paul T。


I have a try catch handler that every so often catches an error without stepping into it's code section. I have put in breakpoints on the opening bracket and first line of code but the exception is thrown without hitting any of the breakpoints.   The message returned from e.what() is "Unknown Exception".

void MyClass::OnUpdate(...)
{

  try {  // Doesn't hit breakpoint
     ... // Doesn't go into here 
  } 
  catch( std::exception & e)
  {
     ... // goes straight into here
  }
}

Any idea why this is happening?


CLight

解决方案

Can you debug in assembly? My guess is that one or more automatic variables are created and/or initialized in the try{} block before the breakpoint is hit. That process is the cause of the exception. You might have a stack problem, 'this' might have been deleted by another thread while you were executing the method, etc.

Paul T.


这篇关于紧凑型7:尝试Catch捕获其职权范围之外的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆