pike.git/
lib/
master.pike.in
Branch:
Tag:
Non-build tags
All tags
No tags
1999-10-06
1999-10-06 14:26:30 by Henrik Grubbström (Grubba) <grubba@grubba.org>
a232724e3643ed2d94d5c475924b971226242290 (
89
lines) (+
50
/-
39
)
[
Show
|
Annotate
]
Branch:
7.9
Added some catches to describe_backtrace().
Rev: lib/master.pike.in:1.58
1:
-
/* $Id: master.pike.in,v 1.
57
1999/10/
05
05
:
31
:
36
hubbe
Exp $
+
/* $Id: master.pike.in,v 1.
58
1999/10/
06
14
:
26
:
30
grubba
Exp $
* * Master-file for Pike. *
1238:
if((arrayp(trace) && sizeof(trace)==2 && stringp(trace[0])) || (objectp(trace) && trace->is_generic_error)) {
-
ret=trace[0];
-
trace=trace[1];
+
if (catch {
+
ret
=
trace[0];
+
trace
=
trace[1];
+
}) {
+
return "Error indexing backtrace!\n";
+
}
}else{ ret=""; }
1248:
{ ret+="No backtrace.\n"; }else{
-
for(e=sizeof(trace)-1;e>=0;e--)
+
for(e
=
sizeof(trace)-1;
e>=0;
e--)
{ mixed tmp; string row;
-
tmp=trace[e];
+
if (catch {
+
tmp
=
trace[e];
if(stringp(tmp)) {
-
row=tmp;
+
row
=
tmp;
} else if(arrayp(tmp)) {
1264:
if(sizeof(tmp)>=3) { if(functionp(tmp[2]))
-
row=function_name(tmp[2]);
+
row
=
function_name(tmp[2]);
else if (stringp(tmp[2])) { row = tmp[2]; } else
1282:
mixed desc="Unknown program"; if(sizeof(tmp)>=3 && functionp(tmp[2])) {
+
catch {
if(mixed tmp=function_object(tmp[2])) if(tmp=object_program(tmp)) if(tmp=describe_program(tmp)) desc=tmp;
-
+
};
} row+=desc; }
1294:
{ row="Destructed object"; }
-
ret+
=
row+
"
\n
";
+
}) {
+
row
=
sprintf(
"
Error indexing backtrace line %d!
"
, e)
;
}
-
+
ret += row + "\n";
}
-
+
}
return ret; }