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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 testArguments(dcp, '{}', false); | 82 testArguments(dcp, '{}', false); |
83 testArguments(dcp, '{"type":"xx"}', false); | 83 testArguments(dcp, '{"type":"xx"}', false); |
84 testArguments(dcp, '{"type":"function"}', false); | 84 testArguments(dcp, '{"type":"function"}', false); |
85 testArguments(dcp, '{"type":"script"}', false); | 85 testArguments(dcp, '{"type":"script"}', false); |
86 testArguments(dcp, '{"target":"f"}', false); | 86 testArguments(dcp, '{"target":"f"}', false); |
87 testArguments(dcp, '{"type":"xx","target":"xx"}', false); | 87 testArguments(dcp, '{"type":"xx","target":"xx"}', false); |
88 testArguments(dcp, '{"type":"function","target":1}', false); | 88 testArguments(dcp, '{"type":"function","target":1}', false); |
89 testArguments(dcp, '{"type":"function","target":"f","line":-1}', false); | 89 testArguments(dcp, '{"type":"function","target":"f","line":-1}', false); |
90 testArguments(dcp, '{"type":"function","target":"f","column":-1}', false); | 90 testArguments(dcp, '{"type":"function","target":"f","column":-1}', false); |
91 testArguments(dcp, '{"type":"function","target":"f","ignoreCount":-1}', fals
e); | |
92 testArguments(dcp, '{"type":"handle","target":"-1"}', false); | 91 testArguments(dcp, '{"type":"handle","target":"-1"}', false); |
93 mirror = debug.MakeMirror(o); | 92 mirror = debug.MakeMirror(o); |
94 testArguments(dcp, '{"type":"handle","target":' + mirror.handle() + '}', fal
se); | 93 testArguments(dcp, '{"type":"handle","target":' + mirror.handle() + '}', fal
se); |
95 | 94 |
96 // Test some legal setbreakpoint requests. | 95 // Test some legal setbreakpoint requests. |
97 testArguments(dcp, '{"type":"function","target":"f"}', true, false); | 96 testArguments(dcp, '{"type":"function","target":"f"}', true, false); |
98 testArguments(dcp, '{"type":"function","target":"h"}', true, false); | 97 testArguments(dcp, '{"type":"function","target":"h"}', true, false); |
99 testArguments(dcp, '{"type":"function","target":"f","line":1}', true, false)
; | 98 testArguments(dcp, '{"type":"function","target":"f","line":1}', true, false)
; |
100 testArguments(dcp, '{"type":"function","target":"f","position":1}', true, fa
lse); | 99 testArguments(dcp, '{"type":"function","target":"f","position":1}', true, fa
lse); |
101 testArguments(dcp, '{"type":"function","target":"f","condition":"i == 1"}',
true, false); | 100 testArguments(dcp, '{"type":"function","target":"f","condition":"i == 1"}',
true, false); |
102 testArguments(dcp, '{"type":"function","target":"f","enabled":true}', true,
false); | 101 testArguments(dcp, '{"type":"function","target":"f","enabled":true}', true,
false); |
103 testArguments(dcp, '{"type":"function","target":"f","enabled":false}', true,
false); | 102 testArguments(dcp, '{"type":"function","target":"f","enabled":false}', true,
false); |
104 testArguments(dcp, '{"type":"function","target":"f","ignoreCount":7}', true,
false); | |
105 | 103 |
106 testArguments(dcp, '{"type":"script","target":"test"}', true, true); | 104 testArguments(dcp, '{"type":"script","target":"test"}', true, true); |
107 testArguments(dcp, '{"type":"script","target":"test"}', true, true); | 105 testArguments(dcp, '{"type":"script","target":"test"}', true, true); |
108 testArguments(dcp, '{"type":"script","target":"test","line":1}', true, true)
; | 106 testArguments(dcp, '{"type":"script","target":"test","line":1}', true, true)
; |
109 testArguments(dcp, '{"type":"script","target":"test","column":1}', true, tru
e); | 107 testArguments(dcp, '{"type":"script","target":"test","column":1}', true, tru
e); |
110 | 108 |
111 testArguments(dcp, '{"type":"scriptId","target":' + f_script_id + ',"line":'
+ f_line + '}', true, false); | 109 testArguments(dcp, '{"type":"scriptId","target":' + f_script_id + ',"line":'
+ f_line + '}', true, false); |
112 testArguments(dcp, '{"type":"scriptId","target":' + g_script_id + ',"line":'
+ g_line + '}', true, false); | 110 testArguments(dcp, '{"type":"scriptId","target":' + g_script_id + ',"line":'
+ g_line + '}', true, false); |
113 testArguments(dcp, '{"type":"scriptId","target":' + h_script_id + ',"line":'
+ h_line + '}', true, false); | 111 testArguments(dcp, '{"type":"scriptId","target":' + h_script_id + ',"line":'
+ h_line + '}', true, false); |
114 | 112 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 assertTrue(!!i_script, "invalid script for i1"); | 205 assertTrue(!!i_script, "invalid script for i1"); |
208 Debug.setScriptBreakPoint(Debug.ScriptBreakPointType.ScriptId, | 206 Debug.setScriptBreakPoint(Debug.ScriptBreakPointType.ScriptId, |
209 i_script.id, 4); | 207 i_script.id, 4); |
210 } | 208 } |
211 | 209 |
212 // Creates the eval script and tries to set the breakpoint. | 210 // Creates the eval script and tries to set the breakpoint. |
213 // The tricky part is that the script function must be strongly reachable at the | 211 // The tricky part is that the script function must be strongly reachable at the |
214 // moment. Since there's no way of simply getting the pointer to the function, | 212 // moment. Since there's no way of simply getting the pointer to the function, |
215 // we run this code while the script function is being activated on stack. | 213 // we run this code while the script function is being activated on stack. |
216 eval('SetBreakpointInI1Script()\nfunction i1(){}\n\n\n\nfunction i2(){}\n'); | 214 eval('SetBreakpointInI1Script()\nfunction i1(){}\n\n\n\nfunction i2(){}\n'); |
OLD | NEW |