本文共 3510 字,大约阅读时间需要 11 分钟。
学习资料:
学习进度跟踪
可以使用VS内置的built-in debugger,或者是WinGBD,不需要使用IDE去build。ninja是用来构建chromium并且大多数开发人员使用cmd来执行ninja build
可以在Solution Explorer并设置启动项Startup Project
symbol_level = 2 默认参数,会有更多的debug info,symbol_level = 1会少一些debug info,so PDBs is smaller。在args.gn里设置
使用VSChromium插件,可以实现代码的索引
参考文档:
翻译以及总结:
不同chrome代码可能会有一些版本冲突的情况,因为配置不一样
--enable-logging --v=1
用于存储一个debug information on remote server,developed by Microsoft。结论:有一个舒服的debug environment
会自动更新一些Source Code
因为chromium的multi-process architecture,导致很难调试。当在IDE Run&Debugger的时候,只有main browser process will be debugged.
ProcessExplorer tool 绘制进程树,可以查看进程间的关系
Two extensions can attach all Chrome processes to debugger
可以使用single-process mode进行完整的调试,但问题在于单进程模式有很多BUG并且一些功能无法正常使用
通过添加命令行 --single-process
VS Attach to process 要选择 native code,否则会attach fail,and get an error message "An operation is not legal in the current state"
有时deubgging something的时机在startup,我们可以使用命令
--renderer-startup-dialog --no-sandbox
必须关闭sandbox,否则dialog box会被禁止显示。当dialog弹出,在VS Tool | Attach to Process,然后就开始debug in render process了,类似的,把render参数改成gpu,ppapi,utility,plugin等等,换成其他 Process Name调试对应的进程
Problem:在哪个地方设置这些参数呢?
可以通过--wait-for-debugger-children[=filter] 让子进程等60s让debugger attach to process
--render-process-limit = 1可以限制Render Process的Spawn numbger
This feature is unuseful
可以往前或者往后,更强大的debug tool
JsDbg 是一个 SV插件,可视化DOM Tree,Layout Tree这样的复杂数据结构
chrome's custom debug visualizers 被加入到 dpb files 并且 自动被VS pick up
定义在src\tools\win\DebugVisualizers中
default.natstepfilter可以配置不进入正则表达式
V8支持一些命令行参数for debugging
GPU 加速渲染可以被Debug
Sometimes it is useful to debug on another machine
Heap Snapshots 可以获取所有未完成分配的 call stacks
Windows heap manager has useful debug flag,可以跟踪每一次内存的分配
转载地址:http://fkcrf.baihongyu.com/