@@ -77,7 +77,7 @@ function htmlspecialchars(str) {
7777 return str ;
7878}
7979
80- function processTrace ( traceData ) {
80+ function processTrace ( traceData , jumpToEnd ) {
8181 curTrace = traceData ;
8282 curInstr = 0 ;
8383
@@ -91,22 +91,6 @@ function processTrace(traceData) {
9191 // GLOBAL!
9292 instrLimitReached = ( lastEntry . event == 'instruction_limit_reached' ) ;
9393
94- // if there is some sort of error, then JUMP to it so that we can
95- // immediately alert the user:
96- // (cgi-bin/pg_logger.py ensures that if there is an uncaught
97- // exception, then that exception event will be the FINAL
98- // entry in curTrace. a caught exception will appear somewhere in
99- // the MIDDLE of curTrace)
100- //
101- // on second thought, let's hold off on that for now
102-
103- /*
104- if (lastEntry.event == 'exception' ||
105- lastEntry.event == 'uncaught_exception') {
106- // updateOutput should take care of the rest ...
107- curInstr = curTrace.length - 1;
108- }
109- */
11094 if ( instrLimitReached ) {
11195 curTrace . pop ( ) // kill last entry
11296 var warningMsg = lastEntry . exception_msg ;
@@ -118,6 +102,23 @@ function processTrace(traceData) {
118102 else if ( curTrace . length == 2 ) {
119103 curTrace . shift ( ) ;
120104 }
105+
106+
107+ if ( jumpToEnd ) {
108+ // if there's an exception, then jump to the FIRST occurrence of
109+ // that exception. otherwise, jump to the very end of execution.
110+ curInstr = curTrace . length - 1 ;
111+
112+ for ( var i = 0 ; i < curTrace . length ; i ++ ) {
113+ var curEntry = curTrace [ i ] ;
114+ if ( curEntry . event == 'exception' ||
115+ curEntry . event == 'uncaught_exception' ) {
116+ curInstr = i ;
117+ break ;
118+ }
119+ }
120+ }
121+
121122 }
122123
123124 updateOutput ( ) ;
0 commit comments