如何从 Window CE 中崩溃给出的地址找到源代码位置
我有一个 Windows mobile 4.0 应用程序,使用 EVC++ 4.0 SP4 和 MFC 编写,在现场表现出随机的偶然崩溃。例如,异常 ox800000002 at 00112584。它不会在各种仿真器和模拟器下发生,因此很难使用调试器进行跟踪。崩溃会抛出地址和异常类型。鉴于我有 PDB,有什么方法可以跟踪这个地址的源头。我无法使用 VC++ 8 重新编译,因为它不支持 mobile 4 SDK。
我的猜测是,如果没有堆栈跟踪,我不会有太多快乐,因为异常可能不在我的源代码中。仍然值得一试。
编辑 根据建议,我查看了该程序的 .MAP 文件上下文中的地址。这揭示了以下内容
Address Publics by Value Rva+Base Lib:Object
0001:00000000 ?GetUnduValue@@YANMM@Z 00011000 f 7Par.obj
'
'
'
0001:001124b8 ?OnLButtonUp@CGXGridUserDragSelectRangeImp@@UAAHPAVCGXGridCore@@AAVCPoint@@AAI@Z 001234b8 f gxseldrg.obj
0001:001126d8 ?OnSelDragStart@CGXGridUserDragSelectRangeImp@@UAAHPAVCGXGridCore@@KK@Z 001236d8 f gxseldrg.obj
,这表明在 CGXGridUserDragSelectRangeImp::OnLButtonUp() 期间发生了错误,这似乎有点奇怪,因为我认为当时没有按下鼠标/键盘/屏幕按钮。可能是在报告崩溃之前堆栈就被破坏了,我在浪费时间。我将使用汇编程序输出重新编译,尝试将其隔离到给定行,但不要抱太大希望:(
映射文件报告分段地址(例如 0001:xxxxxxxxx)和崩溃报告未分段地址这一事实是否意味着我有进行一些计算以从崩溃地址获取映射地址?
I have a Windows mobile 4.0 application, written using EVC++ 4.0 SP4 with MFC, that is exhibiting a random occasional crash in the field. e.g. Exception ox800000002 at 00112584. It does not happen under various emulators and simulators, hence is very difficult to trace using a debugger. The crash throws up and address and exception type. Given that I have the PDB is there any way to track this address to the source. I can't recompile using VC++ 8 as it doesn't support the mobile 4 SDK.
My guess is that without a stack trace I'm not going to have much joy, as the chances are that the exception may not be in my source. Worth a try all the same.
Edit As suggested, I have looked at the address in the context of the .MAP file for the program. This reveals the following
Address Publics by Value Rva+Base Lib:Object
0001:00000000 ?GetUnduValue@@YANMM@Z 00011000 f 7Par.obj
'
'
'
0001:001124b8 ?OnLButtonUp@CGXGridUserDragSelectRangeImp@@UAAHPAVCGXGridCore@@AAVCPoint@@AAI@Z 001234b8 f gxseldrg.obj
0001:001126d8 ?OnSelDragStart@CGXGridUserDragSelectRangeImp@@UAAHPAVCGXGridCore@@KK@Z 001236d8 f gxseldrg.obj
Which suggests the error occured during CGXGridUserDragSelectRangeImp::OnLButtonUp(), which seems a bit odd as I don't think there was a mouse / keyboard / screen button pressed at the time. Could be the stack got fragged before the crash got reported, and I'm wasting my time. I'll recompile with assembler output to try to isolate it to a given line, but don't hold out much hope :(
Does the fact that the map file reports segmented addresses e.g. 0001:xxxxxxxxx and the crash report unsegmented addresses mean I have to carry out some computation to get the map address from the crash address?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我能得到的最接近的是在 Visual Studio 8 上针对 Windows Mobile 6 重新编译,并在调试器下运行。这确实发生了一次这样的崩溃,但并不理想。
Nearest I could get was to recompile against Windows Mobile 6 on Visual Studio 8, and run under the debugger. This did catch one such crash but isn't ideal.