[Tip: Debugging] More debugging skills

Source: Internet
Author: User

Based on researching a issue met on work, I summarize several new points about debugging:

1. process directory. As we know,GetcurrentdirectoryWill return current directory for current process, and setcurrentdirectory can change the directory for current process. when calling loadlibrary, it will search path + process current directory mainly to get the required DLL loaded. detail about DLL search order, please refer:

Http://msdn.microsoft.com/en-us/library/ms682586%28VS.85%29.aspx

2. vs DEBUG => exceptions. as we know, If there happened exceptions in program but there is no place to catch it, our program will crash. but by vs's "exceptions" dialog, we can break when happening those checked exceptions to get better callstack for debugging. it's really useful.

3. further understand PDB file. once you can connect vs debugger.exe with the release application you intent to debug, and to replace the to-be-debugged modules with optimized dll + PDB files, and set proper breakpoints that are to be touched, you can debug your release application now! Key Note: PDB File Stores source file line, etc information.

 

Related Article

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.