Skip to content

Commit f1a548a

Browse files
committed
doc: fix Markdown linter failures
PR-URL: nodejs#476 Reviewed-By: Jack Horton <Jack.Horton@microsoft.com> Reviewed-By: Taylor Woll <tawoll@ntdev.microsoft.com> Reviewed-By: Seth Brenith <sethb@microsoft.com> Reviewed-By: Jimmy Thomson <jithomso@microsoft.com>
1 parent 6d0732b commit f1a548a

File tree

2 files changed

+86
-62
lines changed

2 files changed

+86
-62
lines changed

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Node.js on ChakraCore
22

3-
This project enables Node.js to optionally use the [ChakraCore](https://github.com/Microsoft/ChakraCore)
4-
JavaScript engine. This project is still **work in progress** and not an officially
5-
supported Node.js branch. For more context into this project, please refer to the
3+
This project enables Node.js to optionally use the
4+
[ChakraCore](https://github.com/Microsoft/ChakraCore) JavaScript engine. This
5+
project is still **work in progress** and not an officially supported Node.js
6+
branch. For more context into this project, please refer to the
67
[original PR](https://github.com/nodejs/node/pull/4765).
78

89
### How it works
@@ -19,18 +20,20 @@ to work.
1920

2021
### Time Travel Debugging
2122
Time-Travel debugging is an exciting new addition to Node.js debugging, first
22-
introduced in Node-ChakraCore, and now supported by [VSCode](https://github.com/microsoft/vscode/).
23-
We are developing in the open and want to share our progress to get feedback,
24-
bug reports, functionality requests, and pull-requests from the community.
23+
introduced in Node-ChakraCore, and now supported by
24+
[VSCode](https://github.com/microsoft/vscode/). We are developing in the open
25+
and want to share our progress to get feedback, bug reports, functionality
26+
requests, and pull-requests from the community.
2527

2628
Check out this [Time-Travel Debugging](TTD-README.md)
2729
page to learn how to get started with TTD on Node-ChakraCore with VSCode.
2830

2931
### Node.js API (NAPI)
30-
Node-ChakraCore is an active participant in the [ABI-Stable-Node](https://github.com/nodejs/abi-stable-node)
31-
project also called NAPI. The goal of this project is to ease the lives of native
32-
add-ons developers, by providing a stable Node API which also guarantees stable
33-
ABI across disparate Node versions. This allows native modules to just work across
32+
Node-ChakraCore is an active participant in the
33+
[ABI-Stable-Node](https://github.com/nodejs/abi-stable-node) project also called
34+
NAPI. The goal of this project is to ease the lives of native add-ons
35+
developers, by providing a stable Node API which also guarantees stable ABI
36+
across disparate Node versions. This allows native modules to just work across
3437
different versions and flavors of Node.js without recompilations, reducing the
3538
maintenance cost for module developers and thus improving compatibility.
3639

TTD-README.md

Lines changed: 73 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,73 @@
11
# Diagnostic Tracing and Time Travel Debugging with Node-ChakraCore
2-
In post-mortem debugging scenarios, developers frequently find themselves
2+
In post-mortem debugging scenarios, developers frequently find themselves
33
hunting for failure clues (e.g. error text) in the log files and then searching
4-
for those clues in their code. Once the log statement is found in the source code,
5-
the developer is often left to re-construct the context of the error.
4+
for those clues in their code. Once the log statement is found in the source
5+
code, the developer is often left to re-construct the context of the error.
66

7-
The cutting edge diagnostic capabilities in Node-ChakraCore allows developers to
8-
look at the faulting code within the full fidelity of the debugger with all the
9-
runtime context preserved, enabling them to deeply inspect the code as it was during
10-
the original execution. Node-Chakracore has been extended with a suite of such features
11-
to support tracing and reproducing program executions and a range of updates to improve
12-
the time-travel debugging experience.
7+
The cutting edge diagnostic capabilities in Node-ChakraCore allows developers to
8+
look at the faulting code within the full fidelity of the debugger with all the
9+
runtime context preserved, enabling them to deeply inspect the code as it was
10+
during the original execution. Node-Chakracore has been extended with a suite of
11+
such features to support tracing and reproducing program executions and a range
12+
of updates to improve the time-travel debugging experience.
1313

14-
This project is being developed in the open and we are always happy to get feedback, bug reports,
15-
functionality requests, and pull-requests from the community.
14+
This project is being developed in the open and we are always happy to get
15+
feedback, bug reports, functionality requests, and pull-requests from the
16+
community.
1617

1718
## Diagnostic Tracing
18-
Reproducing issues that depend on a specific interleaving of callbacks, specifics of
19-
a server configuration or users system, or transient network/file-system behavior can be
20-
challenging. To help simplify the process we have updated Node-ChakraCore with a suite
21-
of **diagnostic tracing** features. These features allow you to record an application
22-
execution using the `--record` flag and, then when any of the conditions listed below
23-
occur, a diagnostic trace is written out to disk (with the location printed to
24-
`stderr`).
19+
Reproducing issues that depend on a specific interleaving of callbacks,
20+
specifics of a server configuration or users system, or transient
21+
network/file-system behavior can be challenging. To help simplify the process we
22+
have updated Node-ChakraCore with a suite of **diagnostic tracing** features.
23+
These features allow you to record an application execution using the `--record`
24+
flag and, then when any of the conditions listed below occur, a diagnostic trace
25+
is written out to disk (with the location printed to `stderr`).
2526

2627
Default trace emit events:
2728
- Unhandled exceptions *always* emit a trace.
2829
- Exit with a non-zero exit code *always* emits a trace.
29-
- Failed `asserts` *probabilistically* emit a trace with a backoff to prevent overloading.
30-
- Calls to `console.error` and `console.warn` *probabilistically* emit a trace with a backoff to prevent overloading.
30+
- Failed `asserts` *probabilistically* emit a trace with a backoff to prevent
31+
overloading.
32+
- Calls to `console.error` and `console.warn` *probabilistically* emit a trace
33+
with a backoff to prevent overloading.
3134
- A `SIGINT` signal will *always* emit a trace.
3235

33-
When we run with our remote-file server [demo](https://github.com/mrkmarron/RFSDemoJS) with the record flag and
34-
hit a bug in the file I/O code (followed by crtl-c on the command line) we get the output shown below.
36+
When we run with our remote-file server
37+
[demo](https://github.com/mrkmarron/RFSDemoJS) with the record flag and hit a
38+
bug in the file I/O code (followed by crtl-c on the command line) we get the
39+
output shown below.
3540

3641
![Running node with --record flag and two trace output events.](doc/ttd_assets/TraceSnap.png)
3742

38-
Once written to disk these trace directories can be used locally or copied to another machine
39-
for later analysis and debugging.
43+
Once written to disk these trace directories can be used locally or copied to
44+
another machine for later analysis and debugging.
4045

41-
The animation below shows us launching the `TraceDebug` configuration in the VSCode debugger with the trace
42-
directory argument set to the `emitOnSigInt` trace (written after seeing the file not found error).
43-
When the trace hits the point where it raised and triggered for the error message write it will break into the debugger
44-
allowing us to inspect local variables, the call stack and, set a breakpoint where the callback that received
45-
the I/O error was registered. Then we reverse-execute back-in-time to this callback registration and can
46-
inspect local variables as well as the full call stack as they existed then.
46+
The animation below shows us launching the `TraceDebug` configuration in the
47+
VSCode debugger with the trace directory argument set to the `emitOnSigInt`
48+
trace (written after seeing the file not found error). When the trace hits the
49+
point where it raised and triggered for the error message write it will break
50+
into the debugger allowing us to inspect local variables, the call stack and,
51+
set a breakpoint where the callback that received the I/O error was registered.
52+
Then we reverse-execute back-in-time to this callback registration and can
53+
inspect local variables as well as the full call stack as they existed then.
4754

4855
![Replay debugging with the --replay-debug flag and TTD.](doc/ttd_assets/TTDTrace.gif)
4956

50-
If desired we can single step-back through other statements as well or execute forward again, seeing the
51-
exact set of statements and variable values that existed during the original execution, until we have
52-
all the information we need to understand the problem.
57+
If desired we can single step-back through other statements as well or execute
58+
forward again, seeing the exact set of statements and variable values that
59+
existed during the original execution, until we have all the information we need
60+
to understand the problem.
5361

54-
## Time-Travel Debugging
62+
## Time-Travel Debugging
5563

56-
TTD functionality is available in Node-ChakraCore and is supported by
57-
[VSCode](https://code.visualstudio.com/). You can use VSCode to debug diagnostic
64+
TTD functionality is available in Node-ChakraCore and is supported by
65+
[VSCode](https://code.visualstudio.com/). You can use VSCode to debug diagnostic
5866
traces even if you don't have the project sources available. This is done by:
5967
- Creating an empty `dummy.js` file in the trace directory.
60-
- Adding the following configuration into your `.vscode\launch.json` configuration file.
68+
- Adding the following configuration into your `.vscode\launch.json`
69+
configuration file.
70+
6171
```json
6272
{
6373
"name": "Trace Debug",
@@ -71,7 +81,7 @@ traces even if you don't have the project sources available. This is done by:
7181
"runtimeArgs": [
7282
"run",
7383
"chakracore-nightly",
74-
"--nolazy",
84+
"--nolazy",
7585
"--break-first",
7686
"--replay-debug=./"
7787
],
@@ -83,29 +93,40 @@ traces even if you don't have the project sources available. This is done by:
8393
To get started with diagnostic tracing and TTD you will need the following:
8494

8595
- Install [Node-ChakraCore](https://github.com/nodejs/node-chakracore/releases)
86-
- (Recommended) install [NVS](https://github.com/jasongin/nvs/blob/master/README.md) which is a cross-platform tool for switching between different versions and forks of Node.js and will allow you to easily switch between Node-ChakraCore and other Node.js versions. Once NVS is installed simply enter the following commands in the console:
87-
96+
- (Recommended) install
97+
[NVS](https://github.com/jasongin/nvs/blob/master/README.md) which is a
98+
cross-platform tool for switching between different versions and forks of
99+
Node.js and will allow you to easily switch between Node-ChakraCore and
100+
other Node.js versions. Once NVS is installed simply enter the following
101+
commands in the console:
102+
88103
```console
89104
$ nvs remote chakracore-nightly https://nodejs.org/download/chakracore-nightly/
90105
$ nvs add chakracore-nightly/latest
91106
$ nvs use chakracore-nightly
92107
```
93-
- (Manual) Download the build for your platform/architecture and manually add the location of the binaries to your path.
108+
109+
- (Manual) Download the build for your platform/architecture and manually
110+
add the location of the binaries to your path.
94111
- Install [VSCode](https://code.visualstudio.com/) using the latest installer.
95112

96113
## Sample Program
97-
The code for the Remote File System sample demo'ed at NodeInteractive is available
98-
[here](https://github.com/mrkmarron/RFSDemoJS).
114+
The code for the Remote File System sample demo'ed at NodeInteractive is
115+
available [here](https://github.com/mrkmarron/RFSDemoJS).
99116

100-
You can clone the repo to a location of your choice and `npm install` the dependencies. Once
101-
you launch the application it will serve up the contents of the folder `testdata` on port 3000. The
102-
application is designed to intermittently rename the files `hello_world.js <-> helloWorld.js`
103-
in the background. So, as shown in the screenshot above, a warn trace can be triggered by interacting
104-
with the application and clicking on this file at various times. You can always trigger a sigint
105-
trace via crtl-c at the command line.
117+
You can clone the repo to a location of your choice and `npm install` the
118+
dependencies. Once you launch the application it will serve up the contents of
119+
the folder `testdata` on port 3000. The application is designed to
120+
intermittently rename the files `hello_world.js <-> helloWorld.js` in the
121+
background. So, as shown in the screenshot above, a warn trace can be triggered
122+
by interacting with the application and clicking on this file at various times.
123+
You can always trigger a sigint trace via crtl-c at the command line.
106124

107-
Once this SIGINT trace is written it can be replay debugged in VSCode using the `TraceDebug` launch configuration and you can change the path if you want to debug other trace files that are written.
125+
Once this SIGINT trace is written it can be replay debugged in VSCode using the
126+
`TraceDebug` launch configuration and you can change the path if you want to
127+
debug other trace files that are written.
108128

109129
## Feedback
110-
Please let us know on our [issues page](https://github.com/nodejs/node-chakracore/issues) if
111-
you have any question or comment.
130+
Please let us know on our
131+
[issues page](https://github.com/nodejs/node-chakracore/issues) if you have any
132+
question or comment.

0 commit comments

Comments
 (0)