Bugzilla – Attachment 1 Details for
Bug 12
Better tracing output
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
Patch for BuildComposablePipeline tracing output
trace.diff (text/plain), 2.59 KB, created by
Sven Gothel
on 2003-06-21 10:08:00 CEST
(
hide
)
Description:
Patch for BuildComposablePipeline tracing output
Filename:
MIME Type:
Creator:
Sven Gothel
Created:
2003-06-21 10:08:00 CEST
Size:
2.59 KB
patch
obsolete
>diff -urPwb orig/BuildComposablePipeline.java new/BuildComposablePipeline.java >--- orig/BuildComposablePipeline.java 2003-06-08 21:27:10.000000000 +0200 >+++ new/BuildComposablePipeline.java 2003-06-21 18:56:35.000000000 +0200 >@@ -466,7 +466,26 @@ > protected void postMethodEmissionHook(PrintWriter output) > { > output.println("private PrintStream " + getOutputStreamName() + ";"); >+ output.println("protected String dumpArray(Object obj)"); >+ output.println("{"); >+ output.println(" StringBuffer sb = new StringBuffer(\"[\");"); >+ output.println(" int len = java.lang.reflect.Array.getLength(obj);"); >+ output.println(" int count = Math.min(len,16);"); >+ output.println(" for ( int i =0; i < count; i++ ) {"); >+ output.println(" sb.append(java.lang.reflect.Array.get(obj,i));"); >+ output.println(" if (i < count-1)"); >+ output.println(" sb.append(',');"); >+ output.println(" }"); >+ output.println(" if ( len > 16 )"); >+ output.println(" sb.append(\"...\").append(len);"); >+ output.println(" sb.append(']');"); >+ output.println(" return sb.toString();"); >+ output.println("}"); >+ > } >+ >+ >+ > protected void emitClassDocComment(PrintWriter output) > { > output.println("/** <P> Composable pipline which wraps an underlying {@link GL} implementation,"); >@@ -481,13 +500,33 @@ > > protected void preDownstreamCallHook(PrintWriter output, Method m) > { >- output.println(getOutputStreamName() + ".println(\"Entered " + m.getName() + "\");"); >+ Class[] params = m.getParameterTypes(); >+ >+ output.print(getOutputStreamName() + ".print(\"" + m.getName() + "(\""); >+ for ( int i =0; i < params.length; i++ ) >+ { >+ if ( params[i].isArray() ) >+ output.print("+dumpArray(arg"+i+")"); >+ else >+ output.print("+arg"+i); >+ if ( i < params.length-1) >+ output.print("+\",\""); >+ } >+ output.println("+\")\");"); > output.print(" "); > } > > protected void postDownstreamCallHook(PrintWriter output, Method m) > { >- output.println(" " + getOutputStreamName() + ".println(\"Exited " + m.getName() + "\");"); >+ Class ret = m.getReturnType(); >+ if ( ret != Void.TYPE ) >+ { >+ output.println(" "+getOutputStreamName() + ".println(\" = \"+_res);"); >+ } >+ else >+ { >+ output.println(" "+getOutputStreamName() + ".println();"); >+ } > } > > private String getOutputStreamName() {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 12
: 1 |
2