![]() For example, to generate the database for the release build, run 1 To generate the database for Node.js, add a -C switch when you run configure. The C++ intellisense offered by the cpptools plugin can consume a compilation command database for better understanding of the code base and the build flags that you are using. Tips on using VSCode to develop Node.js core node_g test.js # or out/Debug/node test.jsįor more information check out BUILDING.md in the project directory. node test.js # or out/Release/node test.js ![]() The debug build can be configured by adding -debug when you run the configure script before building Node.js (on non-Windows systems at least, the vcbuild.bat script we use on Windows runs configure for you), and will be built as out/Debug/node (symlinked as. That said the release binary is built with -Os so not everything is available in the release build, and you do need to use a debug build if you want to use V8’s internal debug utilities. The Node.js release binaries do not strip the debug symbols (surprised?) so you don’t necessarily have to build a debug build to get meaningful C/C++ stack traces or to do step debugging in a native debugger like LLDB or GDB. There are also things like Python scripts and DTrace scripts in the code base but I don’t usually need to (or, I don’t really know how to) debug them with anything fancy, so I won’t cover those in this post. This post covers the techniques on how to debug most of them. There are also a bunch of third-party dependencies like v8 or libuv which are placed under the deps directory. ![]() The JS part is mostly under the lib directory and the C++ part is mostly under the src directory. ![]() The source code of Node.js itself is primarily written in C++ and JavaScript. You can skip this section if you already know about the basic structure of the Node.js source code and how to build it. An introduction to Node.js core development workflow Do not rely on them in any project outside the scope of Node.js core. Note that many hidden features mentioned in this post are not meant to be used in the user land of Node.js, and there is zero stability guarantee about them. I thought about writing some guides on this topic in the nodejs/node repo, but it’s easier to throw whatever tricks I personally use on the Internet first - I am also going to heavily use the pronouns “I”, “We” and “You” in this post, and talk about my personal preference here, both of which we always try to avoid in the repo ) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |