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

Side by Side Diff: src/debug-debugger.js

Issue 2050007: Add listbreakpoints command to protocol (Closed)
Patch Set: follow codereview Created 10 years, 7 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 unified diff | Download patch
« no previous file with comments | « src/d8.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after
1259 } else if (request.command == 'break') { 1259 } else if (request.command == 'break') {
1260 this.breakRequest_(request, response); 1260 this.breakRequest_(request, response);
1261 } else if (request.command == 'setbreakpoint') { 1261 } else if (request.command == 'setbreakpoint') {
1262 this.setBreakPointRequest_(request, response); 1262 this.setBreakPointRequest_(request, response);
1263 } else if (request.command == 'changebreakpoint') { 1263 } else if (request.command == 'changebreakpoint') {
1264 this.changeBreakPointRequest_(request, response); 1264 this.changeBreakPointRequest_(request, response);
1265 } else if (request.command == 'clearbreakpoint') { 1265 } else if (request.command == 'clearbreakpoint') {
1266 this.clearBreakPointRequest_(request, response); 1266 this.clearBreakPointRequest_(request, response);
1267 } else if (request.command == 'clearbreakpointgroup') { 1267 } else if (request.command == 'clearbreakpointgroup') {
1268 this.clearBreakPointGroupRequest_(request, response); 1268 this.clearBreakPointGroupRequest_(request, response);
1269 } else if (request.command == 'listbreakpoints') {
1270 this.listBreakpointsRequest_(request, response);
1269 } else if (request.command == 'backtrace') { 1271 } else if (request.command == 'backtrace') {
1270 this.backtraceRequest_(request, response); 1272 this.backtraceRequest_(request, response);
1271 } else if (request.command == 'frame') { 1273 } else if (request.command == 'frame') {
1272 this.frameRequest_(request, response); 1274 this.frameRequest_(request, response);
1273 } else if (request.command == 'scopes') { 1275 } else if (request.command == 'scopes') {
1274 this.scopesRequest_(request, response); 1276 this.scopesRequest_(request, response);
1275 } else if (request.command == 'scope') { 1277 } else if (request.command == 'scope') {
1276 this.scopeRequest_(request, response); 1278 this.scopeRequest_(request, response);
1277 } else if (request.command == 'evaluate') { 1279 } else if (request.command == 'evaluate') {
1278 this.evaluateRequest_(request, response); 1280 this.evaluateRequest_(request, response);
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
1574 return; 1576 return;
1575 } 1577 }
1576 1578
1577 // Clear break point. 1579 // Clear break point.
1578 Debug.clearBreakPoint(break_point); 1580 Debug.clearBreakPoint(break_point);
1579 1581
1580 // Add the cleared break point number to the response. 1582 // Add the cleared break point number to the response.
1581 response.body = { breakpoint: break_point } 1583 response.body = { breakpoint: break_point }
1582 } 1584 }
1583 1585
1586 DebugCommandProcessor.prototype.listBreakpointsRequest_ = function(request, resp onse) {
1587 var array = [];
1588 for (var i = 0; i < script_break_points.length; i++) {
1589 var break_point = script_break_points[i];
1590
1591 var description = {
1592 number: break_point.number(),
1593 line: break_point.line(),
1594 column: break_point.column(),
1595 groupId: break_point.groupId(),
1596 hit_count: break_point.hit_count(),
1597 active: break_point.active(),
1598 condition: break_point.condition(),
1599 ignoreCount: break_point.ignoreCount()
1600 }
1601
1602 if (break_point.type() == Debug.ScriptBreakPointType.ScriptId) {
1603 description.type = 'scriptId';
1604 description.script_id = break_point.script_id();
1605 } else {
1606 description.type = 'scriptName';
1607 description.script_name = break_point.script_name();
1608 }
1609 array.push(description);
1610 }
1611
1612 response.body = { breakpoints: array }
1613 }
1614
1584 1615
1585 DebugCommandProcessor.prototype.backtraceRequest_ = function(request, response) { 1616 DebugCommandProcessor.prototype.backtraceRequest_ = function(request, response) {
1586 // Get the number of frames. 1617 // Get the number of frames.
1587 var total_frames = this.exec_state_.frameCount(); 1618 var total_frames = this.exec_state_.frameCount();
1588 1619
1589 // Create simple response if there are no frames. 1620 // Create simple response if there are no frames.
1590 if (total_frames == 0) { 1621 if (total_frames == 0) {
1591 response.body = { 1622 response.body = {
1592 totalFrames: total_frames 1623 totalFrames: total_frames
1593 } 1624 }
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
2160 case 'string': 2191 case 'string':
2161 case 'number': 2192 case 'number':
2162 json = value; 2193 json = value;
2163 break 2194 break
2164 2195
2165 default: 2196 default:
2166 json = null; 2197 json = null;
2167 } 2198 }
2168 return json; 2199 return json;
2169 } 2200 }
OLDNEW
« no previous file with comments | « src/d8.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698