Nodejs 源码阅读指南
16lz
2021-04-15
原文: https://zhuanlan.zhihu.com/p/83775779
开始之前,可以先尝试在本地编译一下 libuv 的源码。
**Joey:libuv 源码阅读之准备篇**zhuanlan.zhihu.com
1. Build the Node debugging build
$ cd $NODE_HOME # clone 下来的 node 仓库 $ ./configure --debug $ make -j8
2. add launch.json
{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: <https://go.microsoft.com/fwlink/?linkid=830387> "version": "0.2.0", "configurations": [ { "type": "node", "request": "attach", "name": "启动调试", "port": 9228 }, { "name": "node index.js", "type": "lldb", "request": "launch", "program": "${workspaceFolder}/node_g", "args": [ // "--inspect-brk=127.0.0.1:9228", "./hello.js" ], "cwd": "${workspaceFolder}" } ] }
3. add launch.json
- 确保已安装 C/C++ extension 和 CodeLLDB
- 丢个 debug.js 到当前目录,可以随意的打印下 "hello world"
console.log('hello world');
- 在 node_main.c 中设置断点
- enjoy yourself !!!
更多相关文章
- 使用python的tkinter模块实现的GUI版用户登录程序(附源码)
- Linux运维实战——MySQL源码包个性化部署【CentOS】
- spring事务详解(三)源码详解
- spring-boot-2.0.3启动源码篇四 - run方法(三)之createApplicati
- 模拟“嫦娥五号”探月小游戏【附源码】
- 【JavaScript案例】购物车全选和自动计算金额案例(附源码)及ES6模
- 【MySQL】Linux下MySQL 5.5、5.6和5.7的RPM、二进制和源码安装
- crmeb 多商户系统 首页精品推荐 推荐单品 首页新品 热门榜单里面
- 微信小程序服务类目在哪里可以修改?