-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update debugging recommendation to node's default
- Loading branch information
Showing
1 changed file
with
19 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,30 @@ | ||
Debugging | ||
========= | ||
|
||
WebPPL provides error messages that try to be informative. | ||
In addition there is debugging software you can use for WebPPL programs. | ||
|
||
To debug WebPPL programs running in Chrome, enable `pause on JavaScript | ||
exceptions`_ in the Chrome debugger. To debug WebPPL programs running in | ||
nodejs, use node-inspector as follows:: | ||
nodejs, use node debugger as follows: | ||
|
||
1. Add ``debugger;`` statements to ``my-program.wppl`` to indicate breakpoints. | ||
|
||
// 1. Install node-inspector (only need to do this once) | ||
npm install -g node-inspector | ||
2. Run your compiled program in debug mode. | ||
|
||
// 2. Add "debugger;" statements to my-program.wppl to indicate breakpoints | ||
:: | ||
node debug /path/to/webppl/directory/webppl my-program.wppl | ||
|
||
// 3. Run your compiled program in debug mode (will pause automatically) | ||
node --debug-brk webppl my-program.wppl | ||
* Note that you will need the full path to the ``webppl`` executable. | ||
This might be in the ``lib`` folder of your ``node`` directory if | ||
you installed with ``npm``. | ||
|
||
// 4. (In separate terminal:) Load node inspector, resume program execution in node-inspector | ||
node-inspector | ||
3. To navigate to your breakpoint within the debugger interface, type | ||
``cont`` or ``c``. | ||
At any break point, you can type ``repl`` to interact with the | ||
variables. | ||
`Here`_'s some documentation for this debugger. | ||
|
||
.. _pause on JavaScript exceptions: https://developer.chrome.com/devtools/docs/javascript-debugging#pause-on-exceptions | ||
.. _Here: https://nodejs.org/api/debugger.html |