Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Side by Side Diff: test/mjsunit/debug-backtrace.js

Issue 99342: Added support to backtrace from botton of stack to debugger protocol (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/debug-delay.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 var frames = backtrace.frames; 117 var frames = backtrace.frames;
118 assertEquals(2, frames.length); 118 assertEquals(2, frames.length);
119 for (var i = 0; i < frames.length; i++) { 119 for (var i = 0; i < frames.length; i++) {
120 assertEquals('frame', frames[i].type); 120 assertEquals('frame', frames[i].type);
121 } 121 }
122 assertEquals(1, frames[0].index); 122 assertEquals(1, frames[0].index);
123 assertEquals("g", response.lookup(frames[0].func.ref).name); 123 assertEquals("g", response.lookup(frames[0].func.ref).name);
124 assertEquals(2, frames[1].index); 124 assertEquals(2, frames[1].index);
125 assertEquals("", response.lookup(frames[1].func.ref).name); 125 assertEquals("", response.lookup(frames[1].func.ref).name);
126 126
127 // Get backtrace with bottom two frames.
128 json = '{"seq":0,"type":"request","command":"backtrace","arguments":{"fromFr ame":0,"toFrame":2, "bottom":true}}'
129 response = new ParsedResponse(dcp.processDebugJSONRequest(json));
130 backtrace = response.body();
131 assertEquals(1, backtrace.fromFrame);
132 assertEquals(3, backtrace.toFrame);
133 assertEquals(3, backtrace.totalFrames);
134 var frames = backtrace.frames;
135 assertEquals(2, frames.length);
136 for (var i = 0; i < frames.length; i++) {
137 assertEquals('frame', frames[i].type);
138 }
139 assertEquals(1, frames[0].index);
140 assertEquals("g", response.lookup(frames[0].func.ref).name);
141 assertEquals(2, frames[1].index);
142 assertEquals("", response.lookup(frames[1].func.ref).name);
143
127 // Get the individual frames. 144 // Get the individual frames.
128 json = '{"seq":0,"type":"request","command":"frame"}' 145 json = '{"seq":0,"type":"request","command":"frame"}'
129 response = new ParsedResponse(dcp.processDebugJSONRequest(json)); 146 response = new ParsedResponse(dcp.processDebugJSONRequest(json));
130 frame = response.body(); 147 frame = response.body();
131 assertEquals(0, frame.index); 148 assertEquals(0, frame.index);
132 assertEquals("f", response.lookup(frame.func.ref).name); 149 assertEquals("f", response.lookup(frame.func.ref).name);
133 assertTrue(frame.constructCall); 150 assertTrue(frame.constructCall);
134 assertEquals(31, frame.line); 151 assertEquals(31, frame.line);
135 assertEquals(3, frame.column); 152 assertEquals(3, frame.column);
136 assertEquals(2, frame.arguments.length); 153 assertEquals(2, frame.arguments.length);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 Debug.setListener(listener); 235 Debug.setListener(listener);
219 236
220 // Set a break point and call to invoke the debug event listener. 237 // Set a break point and call to invoke the debug event listener.
221 Debug.setBreakPoint(f, 0, 0); 238 Debug.setBreakPoint(f, 0, 0);
222 g(); 239 g();
223 240
224 // Make sure that the debug event listener vas invoked. 241 // Make sure that the debug event listener vas invoked.
225 assertFalse(exception, "exception in listener"); 242 assertFalse(exception, "exception in listener");
226 assertTrue(listenerCalled); 243 assertTrue(listenerCalled);
227 244
OLDNEW
« no previous file with comments | « src/debug-delay.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698