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?
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With