Граф коммитов

156 Коммитов

Автор SHA1 Сообщение Дата
Vasil Dininski d8d472fb03 Fixed a race condition in the debug-server.js
Now setting the port number as a query string. If no port number is provided the default port will be used.
2014-03-21 18:06:42 +02:00
Miroslav Bajtoš bbf989ca5c Use jshint instead of gjslint
Add jshint configuration, configure npm to run jshint in "pretest".

Fix existing issues to make jshint pass.
2014-03-14 08:32:36 +01:00
3y3 4a8b957435 debugger isRunning state changes
Check isRunning state on 'break' and exception 'events'.
Update isRunning state on 'connect' event with help of 'gc' command.
2014-03-13 08:51:22 +04:00
3y3 61f3e08d7f Added subtype property to RemoteObject
Checked: subtype of Array is array
Checked: subtype of Date is date, type is object
Checked: subtype of RegExp is regexp, type is object
Checked: subtype of null is null
2014-03-07 21:55:06 +04:00
3y3 5fd0da6d28 Checked Invalid Date object 2014-03-07 21:55:06 +04:00
3y3 fbdb51422b Fixed wrong proto object link
Checked: Ref object contains protoObject, but not proto
Checked: Uninformative proto object in scope
Checked: Uninformative null proto object
Checked: Uisplaying undefined proto what placed in properties
2014-03-07 21:55:03 +04:00
3y3 ae0461c903 Checking configurable option
configurable option of property now checked
2014-03-07 21:40:38 +04:00
3y3 9d8c82dcd3 Properties conversion isolated to function
convert.v8ObjectToInspectorProperties was added
2014-03-05 23:35:07 +04:00
Miroslav Bajtoš 5f95f5b201 Handle shebang in ScriptFileStorage load/save
Before this change, ScriptFileStorage.load was returning source code
including shebang (#!/usr/bin/node). This prevented the front-end
from matching the file on disk with the script loaded in Node/V8.
As a result, `node-debug _mocha` did not show the breakpoint in
the _mocha file.

ScriptFileStorage.save is preserving shebang when saving the updated
file now, so that live edit works as expected.
2014-02-28 17:28:46 +01:00
Miroslav Bajtoš ffbfbe9e92 Implement Debugger.setSkipAllPauses
Implement the action as no-op for skipped=false. This argument value
is sent by the front-end when pausing program execution.
2014-02-25 15:22:16 -08:00
Miroslav Bajtoš ef9e81aa36 Defer "scriptParsed" until "Page.getResourceTree"
DevTools front-end expects to receive Page.getResourceTree response
before any "scriptParsed" events. When "scriptParsed" arrives first,
the source-map handler throws an exception.

Add FrontendClient methods pauseEvents() and resumeEvents().

Change PageAgent to EventEmitter, add a "resource-tree" event that
is emitted at the time when the Page.getResourceTree response is sent.

FrontendCommandHandler uses these two features to pause events on start
and resume them on "resource-tree".
2014-02-20 17:01:41 +01:00
Miroslav Bajtoš 2f139e6571 bin/inspector: Add -h -v --version options
Refactor lib/config and bin/inspector, split printHelpAndExit into
two parts. The first part is building the help message and stays in
lib/config as `config._describeOptions`. The second part (print and
exit) is moved to bin/inspector.
2014-02-19 19:13:02 +01:00
Miroslav Bajtoš 39fe73b620 Speed up initial parsing of source-map URLs
`ScriptManager._getSourceMapUrl` accepts an optional parameter
`scriptSource`.

`DebuggerAgent._reloadScript` asks V8 to include script sources
in the response.

This way it's not necessary to send another request for each script
that is loaded by V8 at the time when Node Inspector is attaching to
the process.
2014-02-19 18:24:07 +01:00
Miroslav Bajtoš c370aa8146 Cache results of ScriptFileStorage.listScripts. 2014-02-19 18:22:36 +01:00
Miroslav Bajtoš 5e77e4e0c2 Ignore EACCESS errors when listing sources 2014-02-19 18:21:55 +01:00
Miroslav Bajtoš 00a940bf29 Tighten findAllApplicationScripts heuristics
When the directory does not contain package.json, limit the traversal
to top level javascript files and well-known subdirectories:
    lib/
    node_modules/
    test/

This should prevent unintentionaly broad searches like
all files in C:\ drive.
2014-02-19 18:20:52 +01:00
Miroslav Bajtoš 7246a19ce1 RuntimeAgent: implement releaseObject() as no-op 2014-02-18 09:58:26 +01:00
Miroslav Bajtoš fcd311acb7 Fix DebuggerAgent.setVariableValue to object
Fix a bug where object values { objectId: '<id>' } were not correctly
translated to V8 references { handle: <id>}.
2014-02-18 09:58:26 +01:00
Miroslav Bajtoš 4b90c585c8 Add WebSocketServer error handler.
WebSocketServer emits the errors raised by the underlying http.Server,
thus we have to detect and prevent the situation when a single error
is reported twice.
2014-02-17 19:37:37 +01:00
Miroslav Bajtoš 739a578bf0 Fix conversion of Error objects
Convert V8 object with type='error' to DevTools object with
type='object'. This fixes the problem where Error values
were displayed as "undefined" in the front-end.
2014-02-11 08:38:00 +01:00
Kenneth Auchenberg a00f36d336 Use WebSockets instead of socket.io.
Changed the socket implementation to use WS-server, and added
utility function to generate the web socket url with the correct
protocol and relative path.
2014-02-10 07:22:23 +01:00
3y3 c7f5efcf31 Small indentation fixes 2014-02-05 14:09:23 +04:00
3y3 58fbe416bb Help message format update
Updated help message format.
Updated 'help' option description.
Updated 'web-host' option default value
2014-02-05 09:53:51 +04:00
3y3 4f6bc0b43f Fixed display of RegExp objects.
Issue #278
2014-01-23 14:20:41 +01:00
Miroslav Bajtoš b957c705a6 Fixed DebuggerClient.resume acting like stepInto
Fixed the code adding maxStringLength to V8 requests, so that it
no longer creates a new args object when the caller did not provide
one.
2014-01-23 14:15:10 +01:00
3y3 9b1a156f97 Fix Date display format. Issue #281
Removed 'Date: ' prefix.
Added Inspector object type 'date'
Checked test 'appends formatted date to Date description...'
2014-01-17 14:15:40 +01:00
Lennon Pulda-Grealy bb0f19c38b Fixed throw on DebuggerAgent.resume()
Addressed issues/277. The adjustment to args.maxStringLength in
lib/DebuggerClient.js:90 (a fix for issues/29) performed only if args
is defined.
2014-01-16 08:02:28 +01:00
Peter Flannery 127955f600 Added large String support for debugger evaluation requests 2014-01-07 13:47:52 +00:00
Sergey Krilov 1d6aba5236 Improved formatting of Date objects in inspector 2013-12-26 10:36:00 +01:00
Dick Hardt 01cb658ce2 Added --no-preload to disable glob of all *.js
Fixes slow load when lots of *.js files on drive.
2013-12-26 10:29:59 +01:00
Dave ef87549b89 Removed false error messages on reload 2013-12-02 15:10:24 +01:00
Miroslav Bajtos 6fa63fe0fd Added debug logging of communication
Added debug logs for devtools protocol and V8 debugger protocol.

Set DEBUG=node-inspector:protocol:* to enable.
2013-11-13 09:06:01 +01:00
ssafejava 21e8230ac0 Added `stackTraceLimit` configuration, fixes #96.
The new option `stackTraceLimit`, like the corresponding option in
Chrome, allows us to specify how many stack frames we want when
stopped at a breakpoint. It can be set as high as you like.
Negative numbers will cause an error.

The default number of frames is set to 50 to prevent possible
performance issues; if you wish to capture all frames, no matter the
consequences, set this option to a high number, like `99999`.
2013-11-12 09:56:08 +01:00
Miroslav Bajtos 59a3479fef lib,test: fixed lint issues
Added missing semicolons.
2013-09-20 09:03:10 +02:00
Miroslav Bajtos a721b84f14 Quick fix for properties displayed twice in UI
The upgraded front-end sends two requests to get a list of object properties,
each request asking for a different set of variables. Because our back-end was
ignoring request parameters, the same set of variables was returned twice.

This commit fixes the immediate problem, without providing the full
implementation of the new front-end feature.
2013-09-19 18:43:16 +02:00
Miroslav Bajtos bc1834a812 lib: fixed hiding of script files
Modified ScriptFileStorage.findAllApplicationScripts() to exclude files to
hide.

Modified ScriptManager to never hide the main application script file.
2013-09-19 09:08:28 +02:00
Miroslav Bajtos 5115a33780 lib: fix config handling
Fixed DebugServer to pass the correct config object to the Session constructor.

Improved error reporting in lib/config.js.
2013-09-19 09:08:28 +02:00
Miroslav Bajtos 14d54b19ee NetworkAgent: support data scheme URLs
Implemented support for data scheme URLs. This allows sourcemap files to be
embedded in the sourceMappingURL in the generated js file.
2013-09-12 11:06:30 +01:00
Miroslav Bajtos d64c5bf5fa lib,Overrides: support the updated front-end
- Registered additional no-op commands
- Added `column` property to console log messages
- Disabled warning about changes not persisted to filesystem
- Added `hitBreakpoints` to `Debugger.paused` message
- Simplified Debugger._handleChangeLiveOrRestartFrameResponse by removing
  stepIntoAndSendResponse(), as this is handled by front-end now
- Removed patch for `loadXHR()` and implememented source-maps loading using
  the new command `Network.loadResourceForFrontend`.
2013-09-10 11:28:12 +01:00
Miroslav Bajtos 45a2b5ccf0 Emit 'listening' and 'error' events
Modified DebugServer to emit 'listening' and 'error' events, added address()
function for getting the server's address. Moved console logs from DebugServer
to bin/inspector.js.

Modified CLI runner (bin/inspector.js) to forward DebugServer events to
the parent process via `process.send`.

Started embedding guide in `docs/embedding.md`.
2013-09-05 10:16:35 +02:00
3y3 5e78ed4d68 New configuration system based on RC module
Fix for issue #177
[RC module](https://npmjs.org/package/rc)
2013-09-03 11:15:36 +02:00
Miroslav Bajtos e32fb428e9 Bugfix: crash when breakpoint was hit in eval()-ed
Fixed a bug where Node Inspector crashed when a breakpoint was hit in a code
run by eval(). This is happening in two cases:
- Node Inspector calls eval() to get more information about the debugged
  process. In certain circumstances it was possible that the debugger stopped
  inside this code.
- User types `debugger;` in the console panel.

BreakEventHandler was changed to resume the execution in both cases, as if
the sources were hidden.
2013-08-20 13:19:40 +02:00
pflannery e48cca341d DebugServer: Fix for source map paths on win
Related to issue #184
2013-08-12 11:13:37 +02:00
Miroslav Bajtos 0283cf4bd2 PageAgent: improved main-file detection
Fixed the way how we detect the main application file for two cases:
  `node .` (run the local application)
  `node --debug` (start an interactive REPL session)

Fixed also other issues that prevented debugging of REPL sessions.
2013-07-23 10:21:56 +02:00
Miroslav Bajtos ca352b9911 Overrides: show main app file
Added a startup hook that opens the main application file in case no files
are opened.

Created a public API for embedders, added function buildInspectorUrl().
2013-07-22 18:19:27 +02:00
Miroslav Bajtos fdc55decf6 PageAgent: fix for main script without extension
Fixed a bug where `node --debug app` caused node-inspector to add
a non-existent file `app` into the resource tree.
2013-07-22 10:46:38 +02:00
Miroslav Bajtos db0e5d79d1 Added version log message.
Modified bin/inspector to log version on startup.

Improved call-to-action message on server listening.
2013-07-15 13:42:47 +02:00
Miroslav Bajtos 72cedab058 Fixed RuntimeAgent.callFunctionOn() error handling
Modified callFunctionOn() to report errors inside evaluated script as
a success response with `wasThrown: true` instead of throwing an error.

Fixed issue strongloop/node-inspector#26.
2013-07-15 12:04:20 +02:00
Miroslav Bajtos 1b343ecb42 squash! ScriptFileStorage: root detection change
Yet another improvement of root folder detection. Now we consider a folder
as an application root iff it contains `package.json` file.
2013-07-11 10:13:49 +02:00
Miroslav Bajtos 5fa37e9a14 ScriptFileStorage: improved detection of app root
Improved detection of application's root folder to handle better the case
when we are debugging a simple application with no node_modules/lib/test
subfolder.
2013-07-01 19:51:07 +02:00