source: trunk/src/scripttools/debugging/scripts/commands/up.qs@ 5

Last change on this file since 5 was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 941 bytes
Line 
1name = "up";
2
3group = "stack";
4
5shortDescription = "Select and print the stack frame above the current one";
6
7longDescription = "";
8
9seeAlso = [ "down", "frame" ];
10
11function execute() {
12 scheduleGetContextCount();
13 state = 1;
14}
15
16function handleResponse(resp) {
17 if (state == 1) {
18 var count = resp.result;
19 var idx = getCurrentFrameIndex() + 1;
20 if (idx == count) {
21 warning("Already at top (outermost) frame.");
22 return;
23 }
24 setCurrentFrameIndex(idx);
25 scheduleGetContextInfo(idx);
26 state = 2;
27 } else if (state == 2) {
28 var info = resp.result;
29 setCurrentScriptId(info.scriptId);
30 setCurrentLineNumber(info.lineNumber);
31 scheduleGetBacktrace();
32 state = 3;
33 } else if (state == 3) {
34 var backtrace = resp.result;
35 message("#" + getCurrentFrameIndex() + " " + backtrace[getCurrentFrameIndex()]);
36 }
37}
Note: See TracBrowser for help on using the repository browser.