Debug multi-process with DDD

Source: Internet
Author: User

1. debugging object

View the current debugging object: Show follow-fork-Mode

Debug the parent process: Set follow-fork-mode parent

Debug sub-processes: Set follow-fork-mode child

 

2. debugging mode

View the current debugging mode: Show detach-on-Fork

Separation mode: Set detach-on-fork on in this mode, processes that have not been debugged run at full speed

Non-separation mode: Set detach-on-fork off. In this mode, the process that has not been debugged is monitored by GDB.

 

3. General debugging

Add the waiting code in the waiting for debugging:

# Ifdef debug <br/> void debug_wait (INT Debug) <br/>{< br/> do {<br/> If (Debug) <br/> sleep (1); <br/> else <br/> break; <br/>} while (1 ); <br/>}< br/> # else <br/> void debug_wait (INT Debug) <br/>{}< br/> # endif

 

 

 

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.