First, let's make an experiment to see if windbg supports multi-process debugging. First, I write an MFC project named mutiprocess. In this project, I simply add a button to start a thread. The Code is as follows:
// TODO: Add your control notification handler code here
STARTUPINFO StartupInfo;
PROCESS_INFORMATION pi; // Define as global variable, the pi must be transmited to DbgMainLoop (DWORD)
Memset (& StartupInfo, NULL, sizeof (STARTUPINFO ));
Memset (& pi, NULL, sizeof (PROCESS_INFORMATION ));
StartupInfo. cb = sizeof (STARTUPINFO );
// Create the Debuggee process
CreateProcess (
0,
"D: \ C ++ \ debugviewTest \ Debug \ debugviewTest.exe ",
(LPSECURITY_ATTRIBUTES) 0L,
(LPSECURITY_ATTRIBUTES) 0L,
TRUE,
Normal_priority_class,
(Lpvoid) 0l,
(Lptstr) 0l,
& Startupinfo, & PI );
Then compile and start windbg. Select "Open executable.exe" and select the mutiprocess.exe that has been compiled successfully. When the initialization breakpoint is reached, type 'G' directly '. Mutiprocess.exe starts. When
In the frame, after the buttoner is enabled, debugviewtest.exe.pdf debugviewtest.exe is a debugging process. Its functions include breakpoint, Trace, create thread, and remote break point. Then, click the break point, Trace, create thread, and other buttons to find that there is no display in windbg.
After the worker is started, mutiprocess is interrupted to the debugger. At this time, you try to click the break point, Trace, create thread, and other buttons and still find that there is no display in windbg.
So we can conclude that windbg does not support multi-process debugging. However, from the perspective of the windbg debugging structure, windbg supports multi-process debugging, but why does it not implement this function? I have been thinking but have not come to a conclusion, but I think multi-process debugging is still convenient. In the next article, I will introduce how to implement multi-process debugging and its advantages.