Debug child process
-
Hi all, How do I debug a child process inside VC 6.0 or VS in general. The scenario: The main program loads a dll which loads another exe(the process that I wanted to debug), I can debug the dll code fine but can't even set the breakpoint inside created process code. All the related source code was opened inside main program's IDE and all the .pdb files were copied to main program's "debug" dir. Thanks,
-
Hi all, How do I debug a child process inside VC 6.0 or VS in general. The scenario: The main program loads a dll which loads another exe(the process that I wanted to debug), I can debug the dll code fine but can't even set the breakpoint inside created process code. All the related source code was opened inside main program's IDE and all the .pdb files were copied to main program's "debug" dir. Thanks,
Go to HKEY_LOCAL_MACHINE>Software>Microsoft>WindowsNT>CurrentVersion>ImageFileExecution Options. Here you can create a key with the name of your exe.[Assuming you are running windowsXP] eg MyProcess.exe.Create a new string value with the following properties. [Name = debugger, data = vsjitdebugger.exe]. Close the registry editor and start your application. When your child process with the name as "MyProcess.exe" gets launched you would be prompted to attach it with vsjitdebugger. This would only be one way to attach a debugger to your process no sooner than it is launched.
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
Go to HKEY_LOCAL_MACHINE>Software>Microsoft>WindowsNT>CurrentVersion>ImageFileExecution Options. Here you can create a key with the name of your exe.[Assuming you are running windowsXP] eg MyProcess.exe.Create a new string value with the following properties. [Name = debugger, data = vsjitdebugger.exe]. Close the registry editor and start your application. When your child process with the name as "MyProcess.exe" gets launched you would be prompted to attach it with vsjitdebugger. This would only be one way to attach a debugger to your process no sooner than it is launched.
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
Thanks. I just tried out the IFEO method, the debugger did get triggered but it only left me with a new instance of VS 2008 debugger option(I have both VC6.0 and 9.0 installed) for which I have no way to specify the symbol for the debugger. Is it possible to using the existing VC6.0 debugger(I'm using the VC6.0). In addition, will DebugBreak for the debugee do the same thing? Thanks,
-
Thanks. I just tried out the IFEO method, the debugger did get triggered but it only left me with a new instance of VS 2008 debugger option(I have both VC6.0 and 9.0 installed) for which I have no way to specify the symbol for the debugger. Is it possible to using the existing VC6.0 debugger(I'm using the VC6.0). In addition, will DebugBreak for the debugee do the same thing? Thanks,
LiYS wrote:
ith a new instance of VS 2008 debugger option
You can keep VS 6.0 open and then it would show in the list to select from
LiYS wrote:
n addition, will DebugBreak for the debugee do the same thing?
MSDN:The DebugBreak function causes a breakpoint exception to occur in the current process. This allows the calling thread to signal the debugger to handle the exception. The essence is clear now :)
Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_
-
Hi all, How do I debug a child process inside VC 6.0 or VS in general. The scenario: The main program loads a dll which loads another exe(the process that I wanted to debug), I can debug the dll code fine but can't even set the breakpoint inside created process code. All the related source code was opened inside main program's IDE and all the .pdb files were copied to main program's "debug" dir. Thanks,
If you have all the source code, you could simply add the following line very early in the exe:
__asm { int 3 }
This will fire a breakpoint for you to debug. Don't forgot to remove it! Iain.