F12 not working in Delphi debugger on Windows 7/8

限于喜欢 提交于 2019-12-08 16:43:41

问题


Pressing F12 while the program is running in the debugger should break the execution and open the debugger. This works correctly on Windows XP (tested with D2007 and XE2) but fails on Windows 7 and 8 (also tested with D2007 and XE2; tested on three computers).

Registry is set up properly (Windows 7):

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug] "UserDebuggerHotKey"=dword:00000000 "Debugger"="\"C:\Windows\system32\vsjitdebugger.exe\" -p %ld -e %ld"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\AutoExclusionList] "DWM.exe"=dword:00000001

The XP installation also sets "Auto"="1" and omits the AutoExclusionList but duplicating those changes on the Windows 7 machine accomplishes nothing.

The weird thing is that Delphi seems to be aware of the F12 being pressed. When I run a program in a debugger on a Windows 7 machine and press F12, Event Log window in Delphi shows

Thread Start: Thread ID: 4080. Process Project73.exe (7108)

Thread Exit: Thread ID: 4080. Process Project73.exe (7108)

It's just that the breakpoint is not triggered and application keeps running.

Does anybody know how to restore this functionality in Windows 7/8?


回答1:


The Debugger sees that a new thread is started by Windows, but it doesn't know what that thread is. In XP this thread runs into a int 3 break point (DebugBreak()), but under Vista and Windows 7+ the breakpoint isn't hit anymore even if you set the registry key.

There exists a Delphi IDE plugin that catches the thread and calls the DebugBreak() WinAPI function. http://andy.jgknet.de/blog/ide-tools/unsupported-tools/



来源:https://stackoverflow.com/questions/13970455/f12-not-working-in-delphi-debugger-on-windows-7-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!