diff --git a/lib/master.pike.in b/lib/master.pike.in index 386f616e7b54f6b467a8d818e30b3eba3e9f32e2..6b5ce1e62eda16fc226c7773892208f6e523f333 100644 --- a/lib/master.pike.in +++ b/lib/master.pike.in @@ -4548,23 +4548,23 @@ string describe_backtrace(mixed trace, void|int linewidth) for(e = sizeof(trace)-1; e>=end; e--) { - mixed tmp; + mixed frame; string row; if (array err=[array]catch { - tmp = trace[e]; - if(stringp(tmp)) + frame = trace[e]; + if(stringp(frame)) { - row=[string]tmp; + row = [string]frame; } - else if(arrayp(tmp)) + else if(arrayp(frame)) { - if(sprintf("%t",tmp)=="object") { + if(objectp(frame)) { // tmp is backtrace_frame - desc->identify_parts( tmp->args ); + desc->identify_parts( frame->args ); } else - desc->identify_parts( tmp ); - array tmp = [array]tmp; + desc->identify_parts( frame ); + array tmp = [array]frame; string pos; if(sizeof(tmp)>=2 && stringp(tmp[0])) { if (intp(tmp[1])) { @@ -4589,6 +4589,11 @@ string describe_backtrace(mixed trace, void|int linewidth) pos=desc; } + if (objectp(frame) && !undefinedp(frame->total_time)) { + // Profiling. + pos += sprintf(": %dns", frame->total_time); + } + string data; if(sizeof(tmp)>=3) @@ -4619,9 +4624,9 @@ string describe_backtrace(mixed trace, void|int linewidth) } else { - if (tmp) { - if (catch (row = sprintf("%O", tmp))) - row = describe_program(object_program(tmp)) + " with broken _sprintf()"; + if (frame) { + if (catch (row = sprintf("%O", frame))) + row = describe_program(object_program(frame)) + " with broken _sprintf()"; } else { row = "Destructed object"; }