学习资料:《Introducing the Child Process Debugging Power Tool》
学习进度
- 2021.6.25 下午,Ongoing
- 2021.6.25 下午,Finished
Feature and condition
Somebody反馈给VS,要求能够support child process debugging。就是说,在app new(生成) a new(新的)process,VS能够detect this and automatically attaqch a debugger to the new process
The tool works for both F5 and attaching to processes
需要开启native debugger。如果是debugging .NET code,要选择mixed mode debugging。Project | Property | Debugging | Debugger type
安装extension后,通过Debug | Other Debug Targets | Child Process Debugging Settings | checkout Enable child process debugging,child process default use parent process debug engine settings
问题:native type 和 mixed type的区别是什么?
- native type指的是原生代码调试模式,是不需要 公共语言运行时(CLR)环境的,例如C,C++,即内存得自己管理
- 相对于的,managed就是被托管的代码,是由 公共语言运行时(CLR)环境的,例如C#,最后会被编译成native code
- mixed type,就是native code call managed code 或者 managed code call native code
Customed Setting
可以自定义子进程的debug engine而不是inherit from parent
Persist setting 选择将Child Process Debugging Settings的configure到处到.suo / xml files
总结
This extension support debug new child processes,and we can have breakpoint on the process init time