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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 BreakPoint.prototype.func = function() { | 117 BreakPoint.prototype.func = function() { |
118 return this.func_; | 118 return this.func_; |
119 }; | 119 }; |
120 | 120 |
121 | 121 |
122 BreakPoint.prototype.source_position = function() { | 122 BreakPoint.prototype.source_position = function() { |
123 return this.source_position_; | 123 return this.source_position_; |
124 }; | 124 }; |
125 | 125 |
126 | 126 |
127 BreakPoint.prototype.updateSourcePosition = function(new_position, script) { | |
128 this.source_position_ = new_position; | |
129 // TODO(635): also update line and column. | |
130 }; | |
131 | |
132 | |
133 BreakPoint.prototype.hit_count = function() { | 127 BreakPoint.prototype.hit_count = function() { |
134 return this.hit_count_; | 128 return this.hit_count_; |
135 }; | 129 }; |
136 | 130 |
137 | 131 |
138 BreakPoint.prototype.active = function() { | 132 BreakPoint.prototype.active = function() { |
139 if (this.script_break_point()) { | 133 if (this.script_break_point()) { |
140 return this.script_break_point().active(); | 134 return this.script_break_point().active(); |
141 } | 135 } |
142 return this.active_; | 136 return this.active_; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 this.line_ = opt_line || 0; | 232 this.line_ = opt_line || 0; |
239 this.column_ = opt_column; | 233 this.column_ = opt_column; |
240 this.groupId_ = opt_groupId; | 234 this.groupId_ = opt_groupId; |
241 this.hit_count_ = 0; | 235 this.hit_count_ = 0; |
242 this.active_ = true; | 236 this.active_ = true; |
243 this.condition_ = null; | 237 this.condition_ = null; |
244 this.ignoreCount_ = 0; | 238 this.ignoreCount_ = 0; |
245 } | 239 } |
246 | 240 |
247 | 241 |
| 242 //Creates a clone of script breakpoint that is linked to another script. |
| 243 ScriptBreakPoint.prototype.cloneForOtherScript = function (other_script) { |
| 244 var copy = new ScriptBreakPoint(Debug.ScriptBreakPointType.ScriptId, |
| 245 other_script.id, this.line_, this.column_, this.groupId_); |
| 246 copy.number_ = next_break_point_number++; |
| 247 script_break_points.push(copy); |
| 248 |
| 249 copy.hit_count_ = this.hit_count_; |
| 250 copy.active_ = this.active_; |
| 251 copy.condition_ = this.condition_; |
| 252 copy.ignoreCount_ = this.ignoreCount_; |
| 253 return copy; |
| 254 } |
| 255 |
| 256 |
248 ScriptBreakPoint.prototype.number = function() { | 257 ScriptBreakPoint.prototype.number = function() { |
249 return this.number_; | 258 return this.number_; |
250 }; | 259 }; |
251 | 260 |
252 | 261 |
253 ScriptBreakPoint.prototype.groupId = function() { | 262 ScriptBreakPoint.prototype.groupId = function() { |
254 return this.groupId_; | 263 return this.groupId_; |
255 }; | 264 }; |
256 | 265 |
257 | 266 |
(...skipping 15 matching lines...) Expand all Loading... |
273 ScriptBreakPoint.prototype.line = function() { | 282 ScriptBreakPoint.prototype.line = function() { |
274 return this.line_; | 283 return this.line_; |
275 }; | 284 }; |
276 | 285 |
277 | 286 |
278 ScriptBreakPoint.prototype.column = function() { | 287 ScriptBreakPoint.prototype.column = function() { |
279 return this.column_; | 288 return this.column_; |
280 }; | 289 }; |
281 | 290 |
282 | 291 |
| 292 ScriptBreakPoint.prototype.update_positions = function(line, column) { |
| 293 this.line_ = line; |
| 294 this.column_ = column; |
| 295 } |
| 296 |
| 297 |
| 298 |
283 ScriptBreakPoint.prototype.hit_count = function() { | 299 ScriptBreakPoint.prototype.hit_count = function() { |
284 return this.hit_count_; | 300 return this.hit_count_; |
285 }; | 301 }; |
286 | 302 |
287 | 303 |
288 ScriptBreakPoint.prototype.active = function() { | 304 ScriptBreakPoint.prototype.active = function() { |
289 return this.active_; | 305 return this.active_; |
290 }; | 306 }; |
291 | 307 |
292 | 308 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 function UpdateScriptBreakPoints(script) { | 415 function UpdateScriptBreakPoints(script) { |
400 for (var i = 0; i < script_break_points.length; i++) { | 416 for (var i = 0; i < script_break_points.length; i++) { |
401 if (script_break_points[i].type() == Debug.ScriptBreakPointType.ScriptName &
& | 417 if (script_break_points[i].type() == Debug.ScriptBreakPointType.ScriptName &
& |
402 script_break_points[i].matchesScript(script)) { | 418 script_break_points[i].matchesScript(script)) { |
403 script_break_points[i].set(script); | 419 script_break_points[i].set(script); |
404 } | 420 } |
405 } | 421 } |
406 } | 422 } |
407 | 423 |
408 | 424 |
| 425 function GetScriptBreakPoints(script) { |
| 426 var result = []; |
| 427 for (var i = 0; i < script_break_points.length; i++) { |
| 428 if (script_break_points[i].matchesScript(script)) { |
| 429 result.push(script_break_points[i]); |
| 430 } |
| 431 } |
| 432 return result; |
| 433 } |
| 434 |
| 435 |
409 Debug.setListener = function(listener, opt_data) { | 436 Debug.setListener = function(listener, opt_data) { |
410 if (!IS_FUNCTION(listener) && !IS_UNDEFINED(listener) && !IS_NULL(listener)) { | 437 if (!IS_FUNCTION(listener) && !IS_UNDEFINED(listener) && !IS_NULL(listener)) { |
411 throw new Error('Parameters have wrong types.'); | 438 throw new Error('Parameters have wrong types.'); |
412 } | 439 } |
413 %SetDebugEventListener(listener, opt_data); | 440 %SetDebugEventListener(listener, opt_data); |
414 }; | 441 }; |
415 | 442 |
416 | 443 |
417 Debug.breakExecution = function(f) { | 444 Debug.breakExecution = function(f) { |
418 %Break(); | 445 %Break(); |
(...skipping 1730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2149 case 'string': | 2176 case 'string': |
2150 case 'number': | 2177 case 'number': |
2151 json = value; | 2178 json = value; |
2152 break | 2179 break |
2153 | 2180 |
2154 default: | 2181 default: |
2155 json = null; | 2182 json = null; |
2156 } | 2183 } |
2157 return json; | 2184 return json; |
2158 } | 2185 } |
OLD | NEW |