Skip to content

Commit 24e65e7

Browse files
author
Dane Springmeyer
committed
minor case, spelling, and organization fixes
1 parent d0db60e commit 24e65e7

2 files changed

Lines changed: 23 additions & 12 deletions

File tree

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ make test
3737
# Cleans your current builds and removes potential cache
3838
make clean
3939

40+
# Build binaries in Debug mode (https://github.com/mapbox/cpp/blob/master/glossary.md#debug-build)
41+
make debug
42+
4043
# Cleans everything, including the things you download from the network in order to compile (ex: npm packages).
4144
# This is useful if you want to nuke everything and start from scratch.
4245
# For example, it's super useful for making sure everything works for Travis, production, someone else's machine, etc
@@ -133,9 +136,9 @@ Once your project has ported node-cpp-skel, follow these steps to integrate your
133136
### Adding dependencies
134137
With updated versions of npm, a `package-lock.json` file is created, which is now included in node-cpp-skel. See [`npm-and-package-lock.md`](./docs/npm-and-package-lock.md) for more info on how to interact with this file and how to add new dependencies.
135138

136-
### Debug
139+
### Interactive Debugging
137140

138-
* [Debug with VS CODE](./docs/howToDebugWithVSCode.md)
141+
* [Debugging with VS Code](./docs/debugging-with-vs-code.md)
139142

140143
# Code coverage
141144

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
# How to debug C++ with VS Code
22

3-
VS Code is a great tool to develop code in many languages. This document is to tell you how to debug C++ addon with the VS Code.
3+
VS Code is a great source code editor for developing code in many languages. This document is to tell you how to debug a node C++ addon with VS Code.
44

5-
### 1. Setting up VSCode debug
5+
### 1. Setting up VS Code debug
66

7-
To Set up the VSCode debug you have two ways to achieve:
7+
First open the node C++ addon folder in VS Code by choosing `File > Open`.
88

9-
Option 1: Press Cmd + Shift + P to open the command bar, and type open `open launch.json`, choose `C++`.
9+
Then to start debugging there are two ways:
1010

11-
Option 2: Click the debug button on the right sidebar, and Click the ⚙ button on the right top, choose `C++`.
11+
#### Option 1
12+
13+
Press `Cmd + Shift + P` to open the command bar, type open `open launch.json`, and then choose `C++`.
14+
15+
Note: the first time you do this you will need to `install` the C++ Extension and reload the app.
16+
17+
#### Option 2
18+
19+
Click the debug button on the right sidebar, click the `` button on the right top, and then choose `C++`.
1220

1321
![howtodebug](./image/howtodebug1.png)
1422

@@ -34,15 +42,15 @@ In the `launch.json` you can see some template, like this:
3442
}
3543
```
3644

37-
`launch.json` defined which program you want to run after you click the run debug button, let's say we want run `node test/vtshaver.test.js`(In this command we want to use `node` to run `test/vtshaver.test.js`), so we need to change the configurations, put `program` to node's absolute path(you can use `which node` to find the path of current version of node), and change the `args` to `test/vtshaver.test.js`'s absolute path.
45+
`launch.json` defines which program you want to run after you click the run debug button. Let's say we want run `node test/vtshaver.test.js`. In this case we need to change the configurations, put `program` to node's absolute path (you can use `which node` to find the path of current version of node), and change the `args` to `${workspaceFolder}/test/vtshaver.test.js`.
3846

3947
Additional we want build C++ everytime before we start debug, so we add `preLaunchTask` into the config:
4048

4149
```
4250
"preLaunchTask": "npm: build:dev",
4351
```
4452

45-
Untill now, the config file could looks like this:
53+
Now the config file could look like this:
4654

4755

4856
```json
@@ -55,7 +63,7 @@ Untill now, the config file could looks like this:
5563
"request": "launch",
5664
"preLaunchTask": "npm: build:dev",
5765
"program": "/Users/mapbox-mofei/.nvm/versions/node/v8.11.3/bin/node",
58-
"args": ["/Users/mapbox-mofei/dev/mapbox/vtshaver/test/vtshaver.test.js"],
66+
"args": ["${workspaceFolder}/test/vtshaver.test.js"],
5967
"stopAtEntry": false,
6068
"cwd": "${workspaceFolder}",
6169
"environment": [],
@@ -66,10 +74,10 @@ Untill now, the config file could looks like this:
6674
}
6775
```
6876

69-
Now you can open any C++ files and click the left side of the line number to add a breakpoint, then go to the debug button on the sidebar, click the run button on the top.
77+
Now you can open any C++ files and click the left side of the line number to add a breakpoint, then go to the debug button on the sidebar, click the run button on the top.
7078

7179
![howtodebug](./image/howtodebug2.png)
7280

73-
Now everything is done! Debug is Done! The program will stop at the breakpoint, you can use your mouse to explore the variable. If you want you program to continue from the breakpoint, you can navigate the program use the top control box.
81+
Now everything is done! Debug is Done! The program will stop at the breakpoint, you can use your mouse to explore the variable. If you want your program to continue past the breakpoint, you can navigate the program using the top control box.
7482

7583
![howtodebug](./image/howtodebug3.png)

0 commit comments

Comments
 (0)