You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+60-3
Original file line number
Diff line number
Diff line change
@@ -44,11 +44,18 @@ You may also need to [follow these steps](https://github.com/nodejs/node-gyp#use
44
44
When using memoryjs, the target process should match the platform architecture of the Node version running.
45
45
For example if you want to target a 64 bit process, you should try and use a 64 bit version of Node.
46
46
47
-
You also need to recompile the library and target the platform you want. Head to the memoryjs node module directory, open up a terminal and to run the compile scripts, type:
47
+
You also need to recompile the library and target the platform you want. Head to the memoryjs node module directory, open up a terminal and to run the compile scripts, type one of the following:
48
48
49
-
`npm run build32` if you want to target 32 bit processes
49
+
```bash
50
+
# will automatically compile based on the detected Node architecture
51
+
npm run build
50
52
51
-
`npm run build64` if you want to target 64 bit processes
53
+
# compile to target 32 bit processes
54
+
npm run build32
55
+
56
+
# compile to target 64 bit processes
57
+
npm run build64
58
+
```
52
59
53
60
# Node Webkit / Electron
54
61
@@ -581,3 +588,53 @@ setInterval(() => {
581
588
582
589
Note: a loop is not required, e.g. no loop required if you want to simply wait until the first detection of the address being accessed or written to.
583
590
591
+
# Debug
592
+
593
+
### 1. Re-compile the project to be debugged
594
+
595
+
Go to the root directory of the module and run one of the following commands:
596
+
```bash
597
+
# will automatically compile based on the detected Node architecture
598
+
npm run debug
599
+
600
+
# compile to target 32 bit processes
601
+
npm run debug32
602
+
603
+
# compile to target 64 bit processes
604
+
npm run debug64
605
+
```
606
+
607
+
### 2. Change the `index.js` file to require the debug module
608
+
609
+
Go to the root directory and change the line in `index.js` from:
Open the `binding.sln` solution in Visual Studio, found in the `build` folder in the project's root directory.
622
+
623
+
### 4. Setup Visual Studio debug configuration
624
+
625
+
1. In the toolbar, click "Project" then "Properties"
626
+
2. Under "Configuration Properties", click "Debugging"
627
+
3. Set the "Command" property to the location of your `node.exe` file (e.g. `C:\nodejs\node.exe`)
628
+
4. Set the "Command Arguments" property to the location of your script file (e.g. `C:\project\test.js`)
629
+
630
+
### 5. Set breakpoints
631
+
632
+
Explore the project files in Visual Studio (by expanding `..` and then `lib` in the Solution Explorer). Header files can be viewed by holding `Alt` and cilcking on the header file names at the top of the source code files.
633
+
634
+
Breakpoints are set by clicking to the left of the line number.
635
+
636
+
### 6. Run the debugger
637
+
638
+
Start debugging by either pressing `F5`, by clicking "Debug" in the toolbar and then "Start Debugging" or by clicking "Local Windows Debugger".
639
+
640
+
The script you've set as the command argument in step 4 will be run, and Visual Studio will pause on the breakpoints set and allow you to step through the code line by line and inspect variables.
0 commit comments