如何在WinDbg中查看VB6控制级变量?

发布于 2024-12-27 11:57:27 字数 209 浏览 0 评论 0原文

我有一个崩溃文件,在其中我可以看到我自己的 VB6 用户控件之一导致了崩溃;即它的方法之一是堆栈跟踪的一部分,我可以看到负责的行。

从这里,我想检查其成员变量的状态。我该怎么做?

注意:我还有控件的私有符号。问题是能够检查“我”。命令 !object address_of_Me 似乎没有达到目的,所以我不知所措。

谢谢。

I have a crash file where I can see that one of my own VB6 user controls is responsible for the crash; i.e. one of its methods is part of the stack trace and I can see the line responsible.

From here, I'd like to inspect the state of its member variables. How do I do this?

Note: I also have the private symbols for my controls. The problem is being able to inspect "Me". The command !object address_of_Me doesn't seem to do the trick and so I'm at a loss.

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

长途伴 2025-01-03 11:57:27

自从我不得不在 VB6 中执行此操作以来已经有 10 年了,但我记得我过去的生活中有很多 Printer.Print 语句:)

我曾经做过这样的事情来调试(但不是为了发布代码)

Sub MySub
    On Error Goto ErrorTrap
    Dim intX as integer
    Dim intY as integer

    ' do some horrible error here

Exit Sub

ErrorTrap:
    Printer.Print "Error"
    Printer.Print intX
    Printer.Print intY
    Printer.Print ...

End Sub

It's been 10 years since I had to do this in VB6, but I remember a lot of Printer.Print statements in my past life :)

I used to do things like this for debugging (but not for release code)

Sub MySub
    On Error Goto ErrorTrap
    Dim intX as integer
    Dim intY as integer

    ' do some horrible error here

Exit Sub

ErrorTrap:
    Printer.Print "Error"
    Printer.Print intX
    Printer.Print intY
    Printer.Print ...

End Sub
随遇而安 2025-01-03 11:57:27

好吧,codeSMART 有一个选项在您的应用程序上安装全局句柄,第一次调用 SetUnhandledExceptionFilter (win api) 应该在加载模块主窗体或关闭程序时安装,因此调用 SetUnhandledExceptionFilter。

代码有点长,所以复制方法名称 y api 调用

Public Sub InstallGlobalHandler()
On Error Resume Next

If Not lnFilterInstalled Then
    Call SetUnhandledExceptionFilter(AddressOf GlobalExceptionHandler)
    lnFilterInstalled = True
End If
End Sub

Public Sub UninstallGlobalExceptionHandler()
On Error Resume Next

If lnFilterInstalled Then
    Call SetUnhandledExceptionFilter(0&)
    lnFilterInstalled = False
End If
End Sub

这里还有模块的记录结构 y api 声明

- CopyMemory 
- SetUnhandledExceptionFilter
- RaiseException
' Public enums
-EExceptionType
-EExceptionHandlerReturn    
-Private Const EXCEPTION_MAXIMUM_PARAMETERS = 15
' Private record structure
-Private Type CONTEXT      
'Structure that describes an exception.
-Private Type EXCEPTION_RECORD
'Structure that contains exception information that can be used by a debugger.
-Private Type EXCEPTION_DEBUG_INFO
-Private Type EXCEPTION_POINTERS

进行修改 如何将 exe 异常路由回 VB6 应用程序?

well, codeSMART have one option install global handle on your application first call to SetUnhandledExceptionFilter (win api) is should be installed when load your module main or master form when is closing the program so call to SetUnhandledExceptionFilter.

The code is little long so copy methods names y api calls

Public Sub InstallGlobalHandler()
On Error Resume Next

If Not lnFilterInstalled Then
    Call SetUnhandledExceptionFilter(AddressOf GlobalExceptionHandler)
    lnFilterInstalled = True
End If
End Sub

Public Sub UninstallGlobalExceptionHandler()
On Error Resume Next

If lnFilterInstalled Then
    Call SetUnhandledExceptionFilter(0&)
    lnFilterInstalled = False
End If
End Sub

Also here is Record Structure y apis declarations for the module

- CopyMemory 
- SetUnhandledExceptionFilter
- RaiseException
' Public enums
-EExceptionType
-EExceptionHandlerReturn    
-Private Const EXCEPTION_MAXIMUM_PARAMETERS = 15
' Private record structure
-Private Type CONTEXT      
'Structure that describes an exception.
-Private Type EXCEPTION_RECORD
'Structure that contains exception information that can be used by a debugger.
-Private Type EXCEPTION_DEBUG_INFO
-Private Type EXCEPTION_POINTERS

Take a revised that How to route the exe exception back to VB6 app?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文