条件定义以抑制 IDE 拦截 Delphi 6 Pro 中的异常? [英] Conditional define to suppress IDE interception of Exceptions in Delphi 6 Pro?

查看:18
本文介绍了条件定义以抑制 IDE 拦截 Delphi 6 Pro 中的异常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我可以使用 Delphi Pro 6 中的 IDE 设置来阻止 IDE 拦截和处理 Delphi 异常(停止程序并进入调试模式),但不幸的是,这会关闭对所有异常的处理.访问冲突异常发生在我没有源代码的 DLL 中.我想知道是否有一个我不知道的条件符号,我可以在有问题的代码块周围定义/取消定义,所以至少我可以关闭该代码块周围的异常处理.如果没有,也许有什么技巧或技巧可以做到这一点?

I know I can use the IDE settings in Delphi Pro 6 to stop the IDE from intercepting and handling Delphi Exceptions (stopping the program and entering Debug mode), but unfortunately that turns off that handling for all Exceptions. The Access Violation Exception is happening in a DLL that I don't have the source code for. I was wondering if there is a conditional symbol I don't know about that I could define/undefine around the offending code block so at least I could turn off Exception handling around that code block. If not, perhaps some trick or technique to do so?

推荐答案

编译器指令控制编译器和链接器如何将您的源代码转换为可执行代码.调试指令未存储在 DCU 或二进制文件中,因此编译器指令无法控制您要执行的操作.

Compiler directives control how the compiler and linker turn your source code into executable code. Debugging instructions aren't stored in the DCU or the binary, so compiler directives can't control what you're after.

有几种方法可以控制异常处理.我在几年前写的一篇文章中描述了它们:

There are several ways to control exception handling. I've described them in an article I wrote a few years ago:

  • 使用高级断点"来定义调试器应该从哪里开始或停止在异常时中断.
  • 定义调试器将始终忽略的某些异常类.
  • 禁止异常停止.
  • 完全禁用调试.

这篇关于条件定义以抑制 IDE 拦截 Delphi 6 Pro 中的异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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