VB6 调试 - 已编译 [英] VB6 Debugging - compiled

查看:41
本文介绍了VB6 调试 - 已编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的情况是我在我工作的地方支持一个 VB6 应用程序,在过去的几周里,它开始比以往任何时候都更频繁地崩溃.它同时使用本地 Access MDB 数据库和远程 SQL Server DB 进行不同类型的存储.好消息是我们正在编写一个替代应用程序,同时我需要支持这个应用程序,而供应商早已离开这个世界.

My scenario is I'm supporting a VB6 app at the place I work and in the last few weeks it has started crashing more often than it ever used to. It uses both a local Access MDB database and a remote SQL Server DB for different types of storage. The good news is we are writing a replacement app, the band news I need to support this one in the meantime and the vendor is long gone from this world.

我可以尝试哪些方法来诊断崩溃的原因?例如,到目前为止,我已经在客户端 PC 上尝试了 ODBC 跟踪(对于 MDB 组件)、SQL Profiler 跟踪和 ProcMon.

What are some ways I could try and diagnose what is causing the crash? For example so far I've tried ODBC tracing (For the MDB component), SQL Profiler tracing and ProcMon on a client PC.

还有什么我可以尝试发现应用在崩溃时试图做什么的吗?

Is there anything else I could try to discover what the app was trying to do at the time of the crash?

推荐答案

您也可以在调试器中启动.

You can also start in a debugger.

windbg 或 ntsd(ntsd 是一个控制台程序,可能已安装).两者都来自 Debugging Tools For Windows.

windbg or ntsd (ntsd is a console program and maybe installed). Both are also from Debugging Tools For Windows.

下载并安装 Windows 调试工具

Download and install Debugging Tools for Windows

http://msdn.microsoft.com/en-us/windows/hardware/hh852363

安装 Windows SDK,但只需选择调试工具.

Install the Windows SDK but just choose the debugging tools.

在 C:\ 中创建一个名为 Symbols 的文件夹

Create a folder called Symbols in C:\

启动Windbg.文件菜单 - 符号文件路径并回车

Start Windbg. File menu - Symbol File Path and enter

srv*C:\symbols*http://msdl.microsoft.com/download/symbols

然后

windbg -o -g -G c:\windows\system32\cmd.exe /k batfile.bat

您可以按 F12 停止它,kb 将显示调用堆栈(g 继续程序).如果有错误,它也会停止并显示出来.

You can press F12 to stop it and kb will show the call stack (g continues the program). If there's errors it will also stop and show them.

输入 lm 列出加载的模块,x *!* 列出符号,bp symbolname 设置断点

Type lm to list loaded modules, x *!* to list the symbols and bp symbolname to set a breakpoint

使用 db address(如在 db 01244 中查看该内存中的内容.

Use db address (as in db 01244 to see what's at that memory.

如果在 VB6 中编程,则此环境变量 link=/pdb:none 将符号存储在 dll 中而不是单独的文件中.确保在没有优化的情况下编译程序并勾选 Create Symbolic Debug Info 框.都在项目属性的编译选项卡上.

If programming in VB6 then this environmental variable link=/pdb:none stores the symbols in the dll rather than seperate files. Make sure you compile the program with No Optimisations and tick the box for Create Symbolic Debug Info. Both on the Compile tab in the Project's Properties.

这篇关于VB6 调试 - 已编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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