Attach debugger programatically
-
I need to do it from the code, to attach a debugger to a process id, just the same as we can do it from the task manager when u right click a process and click debug. Any help would be appreciated Papa while (TRUE) Papa.WillLove ( Bebe ) ;
Check out the following API calls:-
Private Declare Function DebugActiveProcess Lib "kernel32" (ByVal dwProcessId As Long) As Long Private Declare Function WaitForDebugEvent Lib "kernel32" (lpDebugEvent As DEBUG_EVENT_BUFFER, ByVal dwMilliseconds As Long) As Long Private Declare Function ContinueDebugEvent Lib "kernel32" (ByVal dwProcessId As Long, ByVal dwThreadId As Long, ByVal dwContinueStatus As Long) As Long
I only have this in VB - I'm guessing you want a C/C++ example... '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd -
Check out the following API calls:-
Private Declare Function DebugActiveProcess Lib "kernel32" (ByVal dwProcessId As Long) As Long Private Declare Function WaitForDebugEvent Lib "kernel32" (lpDebugEvent As DEBUG_EVENT_BUFFER, ByVal dwMilliseconds As Long) As Long Private Declare Function ContinueDebugEvent Lib "kernel32" (ByVal dwProcessId As Long, ByVal dwThreadId As Long, ByVal dwContinueStatus As Long) As Long
I only have this in VB - I'm guessing you want a C/C++ example... '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing LtdThanks for your help but i already checked these APIs, and the prob is that im not developping my own debugger i just want to attach to the VC++ debugger. whereas these APIs are issued by the debugger. Hope you get what i mean Papa while (TRUE) Papa.WillLove ( Bebe ) ;
-
Thanks for your help but i already checked these APIs, and the prob is that im not developping my own debugger i just want to attach to the VC++ debugger. whereas these APIs are issued by the debugger. Hope you get what i mean Papa while (TRUE) Papa.WillLove ( Bebe ) ;
-
Ah. You mean that you want your application to attach the VC++ debugger to it, rather than attach your program AS the debugger. Will "MSDEV -p procid -e procid" not do this? Steve S
-
If you want to use the same debugger as configured on the system for just-in-time debugging (which I think is the same as the one used by Task Manager), you can find the path in the Debugger value of the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug.
-
If you want to use the same debugger as configured on the system for just-in-time debugging (which I think is the same as the one used by Task Manager), you can find the path in the Debugger value of the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug.