OLD | NEW |
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 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1322 var break_point = %ToNumber(request.arguments.breakpoint); | 1322 var break_point = %ToNumber(request.arguments.breakpoint); |
1323 | 1323 |
1324 // Check for legal arguments. | 1324 // Check for legal arguments. |
1325 if (!break_point) { | 1325 if (!break_point) { |
1326 response.failed('Missing argument "breakpoint"'); | 1326 response.failed('Missing argument "breakpoint"'); |
1327 return; | 1327 return; |
1328 } | 1328 } |
1329 | 1329 |
1330 // Clear break point. | 1330 // Clear break point. |
1331 Debug.clearBreakPoint(break_point); | 1331 Debug.clearBreakPoint(break_point); |
| 1332 |
| 1333 // Add the cleared break point number to the response. |
| 1334 response.body = { breakpoint: break_point } |
1332 } | 1335 } |
1333 | 1336 |
1334 | 1337 |
1335 DebugCommandProcessor.prototype.backtraceRequest_ = function(request, response)
{ | 1338 DebugCommandProcessor.prototype.backtraceRequest_ = function(request, response)
{ |
1336 // Get the number of frames. | 1339 // Get the number of frames. |
1337 var total_frames = this.exec_state_.frameCount(); | 1340 var total_frames = this.exec_state_.frameCount(); |
1338 | 1341 |
1339 // Create simple response if there are no frames. | 1342 // Create simple response if there are no frames. |
1340 if (total_frames == 0) { | 1343 if (total_frames == 0) { |
1341 response.body = { | 1344 response.body = { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1381 } | 1384 } |
1382 }; | 1385 }; |
1383 | 1386 |
1384 | 1387 |
1385 DebugCommandProcessor.prototype.backtracec = function(cmd, args) { | 1388 DebugCommandProcessor.prototype.backtracec = function(cmd, args) { |
1386 return this.exec_state_.cframesValue(); | 1389 return this.exec_state_.cframesValue(); |
1387 }; | 1390 }; |
1388 | 1391 |
1389 | 1392 |
1390 DebugCommandProcessor.prototype.frameRequest_ = function(request, response) { | 1393 DebugCommandProcessor.prototype.frameRequest_ = function(request, response) { |
| 1394 // No frames no source. |
| 1395 if (this.exec_state_.frameCount() == 0) { |
| 1396 return response.failed('No frames'); |
| 1397 } |
| 1398 |
1391 // With no arguments just keep the selected frame. | 1399 // With no arguments just keep the selected frame. |
1392 if (request.arguments && request.arguments.number >= 0) { | 1400 if (request.arguments && request.arguments.number >= 0) { |
1393 this.exec_state_.setSelectedFrame(request.arguments.number); | 1401 this.exec_state_.setSelectedFrame(request.arguments.number); |
1394 } | 1402 } |
1395 response.body = this.exec_state_.frame(); | 1403 response.body = this.exec_state_.frame(); |
1396 }; | 1404 }; |
1397 | 1405 |
1398 | 1406 |
1399 DebugCommandProcessor.prototype.evaluateRequest_ = function(request, response) { | 1407 DebugCommandProcessor.prototype.evaluateRequest_ = function(request, response) { |
1400 if (!request.arguments) { | 1408 if (!request.arguments) { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1446 } else { | 1454 } else { |
1447 // Evaluate in the selected frame. | 1455 // Evaluate in the selected frame. |
1448 response.body = this.exec_state_.frame().evaluate( | 1456 response.body = this.exec_state_.frame().evaluate( |
1449 expression, Boolean(disable_break)); | 1457 expression, Boolean(disable_break)); |
1450 return; | 1458 return; |
1451 } | 1459 } |
1452 }; | 1460 }; |
1453 | 1461 |
1454 | 1462 |
1455 DebugCommandProcessor.prototype.sourceRequest_ = function(request, response) { | 1463 DebugCommandProcessor.prototype.sourceRequest_ = function(request, response) { |
| 1464 // No frames no source. |
| 1465 if (this.exec_state_.frameCount() == 0) { |
| 1466 return response.failed('No source'); |
| 1467 } |
| 1468 |
1456 var from_line; | 1469 var from_line; |
1457 var to_line; | 1470 var to_line; |
1458 var frame = this.exec_state_.frame(); | 1471 var frame = this.exec_state_.frame(); |
1459 if (request.arguments) { | 1472 if (request.arguments) { |
1460 // Pull out arguments. | 1473 // Pull out arguments. |
1461 from_line = request.arguments.fromLine; | 1474 from_line = request.arguments.fromLine; |
1462 to_line = request.arguments.toLine; | 1475 to_line = request.arguments.toLine; |
1463 | 1476 |
1464 if (!IS_UNDEFINED(request.arguments.frame)) { | 1477 if (!IS_UNDEFINED(request.arguments.frame)) { |
1465 var frame_number = %ToNumber(request.arguments.frame); | 1478 var frame_number = %ToNumber(request.arguments.frame); |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1662 json += NumberToJSON_(elem); | 1675 json += NumberToJSON_(elem); |
1663 } else if (IS_STRING(elem)) { | 1676 } else if (IS_STRING(elem)) { |
1664 json += StringToJSON_(elem); | 1677 json += StringToJSON_(elem); |
1665 } else { | 1678 } else { |
1666 json += elem; | 1679 json += elem; |
1667 } | 1680 } |
1668 } | 1681 } |
1669 json += ']'; | 1682 json += ']'; |
1670 return json; | 1683 return json; |
1671 } | 1684 } |
OLD | NEW |