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 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1064 request.arguments.enabled = true; | 1064 request.arguments.enabled = true; |
1065 break; | 1065 break; |
1066 case 'disable': | 1066 case 'disable': |
1067 request.arguments.enabled = false; | 1067 request.arguments.enabled = false; |
1068 break; | 1068 break; |
1069 case 'ignore': | 1069 case 'ignore': |
1070 request.arguments.ignoreCount = parseInt(otherArgs); | 1070 request.arguments.ignoreCount = parseInt(otherArgs); |
1071 break; | 1071 break; |
1072 default: | 1072 default: |
1073 throw new Error('Invalid arguments.'); | 1073 throw new Error('Invalid arguments.'); |
1074 » } | 1074 } |
1075 } else { | 1075 } else { |
1076 throw new Error('Invalid arguments.'); | 1076 throw new Error('Invalid arguments.'); |
1077 } | 1077 } |
1078 | 1078 |
1079 return request.toJSONProtocol(); | 1079 return request.toJSONProtocol(); |
1080 }; | 1080 }; |
1081 | 1081 |
1082 | 1082 |
1083 // Create a JSON request for the disconnect command. | 1083 // Create a JSON request for the disconnect command. |
1084 DebugRequest.prototype.disconnectCommandToJSONRequest_ = function(args) { | 1084 DebugRequest.prototype.disconnectCommandToJSONRequest_ = function(args) { |
1085 var request; | 1085 var request; |
1086 request = this.createRequest('disconnect'); | 1086 request = this.createRequest('disconnect'); |
1087 return request.toJSONProtocol(); | 1087 return request.toJSONProtocol(); |
1088 }; | 1088 }; |
1089 | 1089 |
1090 | 1090 |
1091 // Create a JSON request for the info command. | 1091 // Create a JSON request for the info command. |
1092 DebugRequest.prototype.infoCommandToJSONRequest_ = function(args) { | 1092 DebugRequest.prototype.infoCommandToJSONRequest_ = function(args) { |
1093 var request; | 1093 var request; |
1094 if (args && (args == 'break' || args == 'br')) { | 1094 if (args && (args == 'break' || args == 'br')) { |
1095 // Build a evaluate request from the text command. | 1095 // Build a evaluate request from the text command. |
1096 request = this.createRequest('listbreakpoints'); | 1096 request = this.createRequest('listbreakpoints'); |
1097 » last_cmd = 'info break'; | 1097 last_cmd = 'info break'; |
1098 } else if (args && (args == 'locals' || args == 'lo')) { | 1098 } else if (args && (args == 'locals' || args == 'lo')) { |
1099 // Build a evaluate request from the text command. | 1099 // Build a evaluate request from the text command. |
1100 » request = this.createRequest('frame'); | 1100 request = this.createRequest('frame'); |
1101 » last_cmd = 'info locals'; | 1101 last_cmd = 'info locals'; |
1102 } else if (args && (args == 'args' || args == 'ar')) { | 1102 } else if (args && (args == 'args' || args == 'ar')) { |
1103 // Build a evaluate request from the text command. | 1103 // Build a evaluate request from the text command. |
1104 » request = this.createRequest('frame'); | 1104 request = this.createRequest('frame'); |
1105 » last_cmd = 'info args'; | 1105 last_cmd = 'info args'; |
1106 } else { | 1106 } else { |
1107 throw new Error('Invalid info arguments.'); | 1107 throw new Error('Invalid info arguments.'); |
1108 } | 1108 } |
1109 | 1109 |
1110 return request.toJSONProtocol(); | 1110 return request.toJSONProtocol(); |
1111 }; | 1111 }; |
1112 | 1112 |
1113 | 1113 |
1114 DebugRequest.prototype.v8FlagsToJSONRequest_ = function(args) { | 1114 DebugRequest.prototype.v8FlagsToJSONRequest_ = function(args) { |
1115 var request; | 1115 var request; |
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2171 json += NumberToJSON_(elem); | 2171 json += NumberToJSON_(elem); |
2172 } else if (typeof(elem) === 'string') { | 2172 } else if (typeof(elem) === 'string') { |
2173 json += StringToJSON_(elem); | 2173 json += StringToJSON_(elem); |
2174 } else { | 2174 } else { |
2175 json += elem; | 2175 json += elem; |
2176 } | 2176 } |
2177 } | 2177 } |
2178 json += ']'; | 2178 json += ']'; |
2179 return json; | 2179 return json; |
2180 } | 2180 } |
OLD | NEW |