How do I debug a designtime package unloading crash involving a crash in ThreadProc in Classes.pas?

前端 未结 1 1919
予麋鹿
予麋鹿 2021-01-14 14:28

I am not sure how to track down the following crash:

  1. It happens when Unloading a Designtime Package that is used in-house at my company. It is our code, thu

相关标签:
1条回答
  • 2021-01-14 14:58

    I debugged the designtime package crash in the following manner:

    1. As already noted above, set up Delphi to run itself, using Run Parameters, in the Host Application, the path is c:\path-to-delphi-install\bin\bds.exe.

    2. Set a breakpoint in the line in function ThreadProc in System.pas.

    3. Open windows.pas, and around line 30,000-33,000 there is a line like this:

      function CreateThread; external kernel32 name 'CreateThread';

    Set a breakpoint on the line above with F8. Now when anything in the code being debugged invokes that Win32 function, whether via TThread or not, you'll get a breakpoint.

    enter image description here

    0 讨论(0)
提交回复
热议问题