Windbg and multi-process debugging

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.