OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 case 'exit': | 385 case 'exit': |
386 case 'quit': | 386 case 'quit': |
387 this.request_ = this.disconnectCommandToJSONRequest_(args); | 387 this.request_ = this.disconnectCommandToJSONRequest_(args); |
388 break; | 388 break; |
389 | 389 |
390 case 'up': | 390 case 'up': |
391 this.request_ = | 391 this.request_ = |
392 this.frameCommandToJSONRequest_('' + | 392 this.frameCommandToJSONRequest_('' + |
393 (Debug.State.currentFrame + 1)); | 393 (Debug.State.currentFrame + 1)); |
394 break; | 394 break; |
395 | 395 |
396 case 'down': | 396 case 'down': |
397 case 'do': | 397 case 'do': |
398 this.request_ = | 398 this.request_ = |
399 this.frameCommandToJSONRequest_('' + | 399 this.frameCommandToJSONRequest_('' + |
400 (Debug.State.currentFrame - 1)); | 400 (Debug.State.currentFrame - 1)); |
401 break; | 401 break; |
402 | 402 |
403 case 'set': | 403 case 'set': |
404 case 'print': | 404 case 'print': |
405 case 'p': | 405 case 'p': |
406 this.request_ = this.printCommandToJSONRequest_(args); | 406 this.request_ = this.printCommandToJSONRequest_(args); |
407 break; | 407 break; |
408 | 408 |
409 case 'dir': | 409 case 'dir': |
410 this.request_ = this.dirCommandToJSONRequest_(args); | 410 this.request_ = this.dirCommandToJSONRequest_(args); |
411 break; | 411 break; |
412 | 412 |
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1065 if (arg1 == 'exc' || arg1 == 'exception' || arg1 == 'exceptions') { | 1065 if (arg1 == 'exc' || arg1 == 'exception' || arg1 == 'exceptions') { |
1066 | 1066 |
1067 var arg2 = (nextPos > 0) ? | 1067 var arg2 = (nextPos > 0) ? |
1068 args.substring(nextPos + 1, args.length) : 'all'; | 1068 args.substring(nextPos + 1, args.length) : 'all'; |
1069 if (!arg2) { | 1069 if (!arg2) { |
1070 arg2 = 'all'; // if unspecified, set for all. | 1070 arg2 = 'all'; // if unspecified, set for all. |
1071 } if (arg2 == 'unc') { // check for short cut. | 1071 } if (arg2 == 'unc') { // check for short cut. |
1072 arg2 = 'uncaught'; | 1072 arg2 = 'uncaught'; |
1073 } | 1073 } |
1074 excType = arg2; | 1074 excType = arg2; |
1075 | 1075 |
1076 // Check for: | 1076 // Check for: |
1077 // en[able] [all|unc[aught]] exc[eptions] | 1077 // en[able] [all|unc[aught]] exc[eptions] |
1078 // dis[able] [all|unc[aught]] exc[eptions] | 1078 // dis[able] [all|unc[aught]] exc[eptions] |
1079 } else if (arg1 == 'all' || arg1 == 'unc' || arg1 == 'uncaught') { | 1079 } else if (arg1 == 'all' || arg1 == 'unc' || arg1 == 'uncaught') { |
1080 | 1080 |
1081 var arg2 = (nextPos > 0) ? | 1081 var arg2 = (nextPos > 0) ? |
1082 args.substring(nextPos + 1, args.length) : null; | 1082 args.substring(nextPos + 1, args.length) : null; |
1083 if (arg2 == 'exc' || arg1 == 'exception' || arg1 == 'exceptions') { | 1083 if (arg2 == 'exc' || arg1 == 'exception' || arg1 == 'exceptions') { |
1084 excType = arg1; | 1084 excType = arg1; |
1085 if (excType == 'unc') { | 1085 if (excType == 'unc') { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 case 'enable': | 1124 case 'enable': |
1125 request.arguments.enabled = true; | 1125 request.arguments.enabled = true; |
1126 break; | 1126 break; |
1127 case 'disable': | 1127 case 'disable': |
1128 request.arguments.enabled = false; | 1128 request.arguments.enabled = false; |
1129 break; | 1129 break; |
1130 case 'ignore': | 1130 case 'ignore': |
1131 request.arguments.ignoreCount = parseInt(otherArgs); | 1131 request.arguments.ignoreCount = parseInt(otherArgs); |
1132 break; | 1132 break; |
1133 default: | 1133 default: |
1134 throw new Error('Invalid arguments.'); | 1134 throw new Error('Invalid arguments.'); |
1135 } | 1135 } |
1136 } else { | 1136 } else { |
1137 throw new Error('Invalid arguments.'); | 1137 throw new Error('Invalid arguments.'); |
1138 } | 1138 } |
1139 | 1139 |
1140 return request.toJSONProtocol(); | 1140 return request.toJSONProtocol(); |
1141 }; | 1141 }; |
1142 | 1142 |
1143 | 1143 |
1144 // Create a JSON request for the disconnect command. | 1144 // Create a JSON request for the disconnect command. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1245 | 1245 |
1246 // Check for i[ndex] <i>: | 1246 // Check for i[ndex] <i>: |
1247 } else if (arg === 'index' || arg === 'i') { | 1247 } else if (arg === 'index' || arg === 'i') { |
1248 i++; | 1248 i++; |
1249 if (args.length < i) { | 1249 if (args.length < i) { |
1250 throw new Error('Missing index after ' + arg + '.'); | 1250 throw new Error('Missing index after ' + arg + '.'); |
1251 } | 1251 } |
1252 start_index = parseInt(args[i]); | 1252 start_index = parseInt(args[i]); |
1253 // The user input start index starts at 1: | 1253 // The user input start index starts at 1: |
1254 if (start_index <= 0) { | 1254 if (start_index <= 0) { |
1255 throw new Error('Invalid index ' + args[i] + '.'); | 1255 throw new Error('Invalid index ' + args[i] + '.'); |
1256 } | 1256 } |
1257 start_index -= 1; | 1257 start_index -= 1; |
1258 is_verbose = true; | 1258 is_verbose = true; |
1259 | 1259 |
1260 // Check for t[ype] <type>: | 1260 // Check for t[ype] <type>: |
1261 } else if (arg === 'type' || arg === 't') { | 1261 } else if (arg === 'type' || arg === 't') { |
1262 i++; | 1262 i++; |
1263 if (args.length < i) { | 1263 if (args.length < i) { |
1264 throw new Error('Missing type after ' + arg + '.'); | 1264 throw new Error('Missing type after ' + arg + '.'); |
1265 } | 1265 } |
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2014 if (body.breakpoints.length === 0) { | 2014 if (body.breakpoints.length === 0) { |
2015 result = "No user defined breakpoints\n"; | 2015 result = "No user defined breakpoints\n"; |
2016 } else { | 2016 } else { |
2017 result += '\n'; | 2017 result += '\n'; |
2018 } | 2018 } |
2019 if (body.breakOnExceptions) { | 2019 if (body.breakOnExceptions) { |
2020 result += '* breaking on ALL exceptions is enabled\n'; | 2020 result += '* breaking on ALL exceptions is enabled\n'; |
2021 } else if (body.breakOnUncaughtExceptions) { | 2021 } else if (body.breakOnUncaughtExceptions) { |
2022 result += '* breaking on UNCAUGHT exceptions is enabled\n'; | 2022 result += '* breaking on UNCAUGHT exceptions is enabled\n'; |
2023 } else { | 2023 } else { |
2024 result += '* all exception breakpoints are disabled\n'; | 2024 result += '* all exception breakpoints are disabled\n'; |
2025 } | 2025 } |
2026 details.text = result; | 2026 details.text = result; |
2027 break; | 2027 break; |
2028 | 2028 |
2029 case 'setexceptionbreak': | 2029 case 'setexceptionbreak': |
2030 result = 'Break on ' + body.type + ' exceptions: '; | 2030 result = 'Break on ' + body.type + ' exceptions: '; |
2031 result += body.enabled ? 'enabled' : 'disabled'; | 2031 result += body.enabled ? 'enabled' : 'disabled'; |
2032 details.text = result; | 2032 details.text = result; |
2033 break; | 2033 break; |
2034 | 2034 |
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2798 json += NumberToJSON_(elem); | 2798 json += NumberToJSON_(elem); |
2799 } else if (typeof(elem) === 'string') { | 2799 } else if (typeof(elem) === 'string') { |
2800 json += StringToJSON_(elem); | 2800 json += StringToJSON_(elem); |
2801 } else { | 2801 } else { |
2802 json += elem; | 2802 json += elem; |
2803 } | 2803 } |
2804 } | 2804 } |
2805 json += ']'; | 2805 json += ']'; |
2806 return json; | 2806 return json; |
2807 } | 2807 } |
OLD | NEW |