Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Unified Diff: src/d8.js

Issue 48009: Add thread information to the debugger (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/debug-delay.js » ('j') | src/runtime.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8.js
===================================================================
--- src/d8.js (revision 1518)
+++ src/d8.js (working copy)
@@ -324,6 +324,10 @@
this.request_ = this.clearCommandToJSONRequest_(args);
break;
+ case 'threads':
+ this.request_ = this.threadsCommandToJSONRequest_(args);
+ break;
+
case 'trace':
// Return undefined to indicate command handled internally (no JSON).
this.request_ = void 0;
@@ -686,6 +690,14 @@
};
+// Create a JSON request for the threads command.
+DebugRequest.prototype.threadsCommandToJSONRequest_ = function(args) {
+ // Build a threads request from the text command.
+ var request = this.createRequest('threads');
+ return request.toJSONProtocol();
+};
+
+
// Handle the trace command.
DebugRequest.prototype.traceCommand_ = function(args) {
// Process arguments.
@@ -919,6 +931,18 @@
details.text = result;
break;
+ case 'threads':
+ var result = 'Active V8 threads: ' + body.totalThreads + '\n';
+ body.threads.sort(function(a, b) { return a.id - b.id; });
+ for (i = 0; i < body.threads.length; i++) {
+ result += body.threads[i].current ? '*' : ' ';
+ result += ' ';
+ result += body.threads[i].id;
+ result += '\n';
+ }
+ details.text = result;
+ break;
+
case 'continue':
details.text = "(running)";
break;
« no previous file with comments | « no previous file | src/debug-delay.js » ('j') | src/runtime.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698