ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From whitl...@apache.org
Subject cvs commit: ws-axis/c/tools/org/apache/axis/tools/trace Tracer.java
Date Thu, 03 Mar 2005 09:59:40 GMT
whitlock    2005/03/03 01:59:39

  Modified:    c/src/common AxisTrace.cpp AxisTrace.h
               c/tools/org/apache/axis/tools/trace Tracer.java
  Log:
  AXISCPP-483 Trace this on exit and catch
  Output this as @12345678 not |12345678|
  
  Revision  Changes    Path
  1.59      +5 -5      ws-axis/c/src/common/AxisTrace.cpp
  
  Index: AxisTrace.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/common/AxisTrace.cpp,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- AxisTrace.cpp	18 Feb 2005 17:56:49 -0000	1.58
  +++ AxisTrace.cpp	3 Mar 2005 09:59:39 -0000	1.59
  @@ -272,7 +272,7 @@
   	text += " ";
   	if (NULL != that) {
   		char prim[32];
  -		sprintf(prim,"|%p|",that);
  +		sprintf(prim,"@%p",that);
   		text += prim;
   		if (NULL!=parms) text += ",";
   	}
  @@ -334,7 +334,7 @@
       }
   }
   
  -void AxisTrace::traceExitInternal(const char *className, const char *methodName, int returnIndex,
  +void AxisTrace::traceExitInternal(const char *className, const char *methodName, const
void* that, int returnIndex,
   						  int type, unsigned len, void *value)
   {
       if (!isTraceOn()) return;
  @@ -356,13 +356,13 @@
   			added = true;
   		}
   
  -		traceLineInternal(TRACE_EXIT,className,methodName,NULL,added?line.c_str():NULL);
  +		traceLineInternal(TRACE_EXIT,className,methodName,that,added?line.c_str():NULL);
       } catch (...) {
           traceLineInternal(TRACE_EXCEPT,NULL,NULL,NULL,"Unknown exception caught during
trace exit");
       }
   }
   
  -void AxisTrace::traceCatchInternal(const char *className, const char *methodName, int catchIndex,
  +void AxisTrace::traceCatchInternal(const char *className, const char *methodName, const
void* that, int catchIndex,
   						   int type, unsigned len, void *value)
   {
       if (!isTraceOn()) return;
  @@ -381,7 +381,7 @@
   		if (TRACETYPE_UNKNOWN != type)
   			addParameter(line,type,len,value);
           else line += "\"...\"";
  -		traceLineInternal(TRACE_EXCEPT,className,methodName,NULL,line.c_str());
  +		traceLineInternal(TRACE_EXCEPT,className,methodName,that,line.c_str());
       } catch (...) {
           traceLineInternal(TRACE_EXCEPT,NULL,NULL,NULL,"Unknown exception caught during
trace catch");
       }
  
  
  
  1.33      +12 -12    ws-axis/c/src/common/AxisTrace.h
  
  Index: AxisTrace.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/common/AxisTrace.h,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- AxisTrace.h	18 Feb 2005 17:56:49 -0000	1.32
  +++ AxisTrace.h	3 Mar 2005 09:59:39 -0000	1.33
  @@ -108,9 +108,9 @@
   public:
       void (*m_traceLine)(const char *data);
       void (*m_traceEntry)(const char *className, const char *methodName, const void* that,
int nParms, va_list vargs);
  -    void (*m_traceExit)(const char *className, const char *methodName, int returnIndex,
  +    void (*m_traceExit)(const char *className, const char *methodName, const void* that,
int returnIndex,
   		int type, unsigned len, void *value);
  -    void (*m_traceCatch)(const char *className, const char *methodName, int catchIndex,
  +    void (*m_traceCatch)(const char *className, const char *methodName, const void* that,
int catchIndex,
   		int type, unsigned len, void *value);
       bool m_traceOn;
   };
  @@ -230,34 +230,34 @@
   	 * Traces the exit to a method.
   	 */
   #ifdef AXISTRACE_LIBRARY
  -    static inline void traceExit(const char *className, const char *methodName, int returnIndex,
  +    static inline void traceExit(const char *className, const char *methodName, const void*
that, int returnIndex,
   		int type=TRACETYPE_UNKNOWN, unsigned len=0, void *value=0) { 
  -            (*g_traceEntrypoints->m_traceExit)(className,methodName,returnIndex,type,len,value);

  +            (*g_traceEntrypoints->m_traceExit)(className,methodName,that,returnIndex,type,len,value);

       }
   #else
  -    static inline void traceExit(const char *className, const char *methodName, int returnIndex,
  +    static inline void traceExit(const char *className, const char *methodName, const void*
that, int returnIndex,
   		int type=TRACETYPE_UNKNOWN, unsigned len=0, void *value=0) {
  -        traceExitInternal(className,methodName,returnIndex,type,len,value);
  +        traceExitInternal(className,methodName,that,returnIndex,type,len,value);
       }
   #endif
  -	static void traceExitInternal(const char *className, const char *methodName, int returnIndex,
  +	static void traceExitInternal(const char *className, const char *methodName, const void*
that, int returnIndex,
   		int type=TRACETYPE_UNKNOWN, unsigned len=0, void *value=0);
   
   	/**
   	 * Traces something that has been caught
   	 */
   #ifdef AXISTRACE_LIBRARY
  -    static inline void traceCatch(const char *className, const char *methodName, int catchIndex,
  +    static inline void traceCatch(const char *className, const char *methodName, const
void* that, int catchIndex,
   		int type=TRACETYPE_UNKNOWN, unsigned len=0, void *value=0) { 
  -            (*g_traceEntrypoints->m_traceCatch)(className,methodName,catchIndex,type,len,value);

  +            (*g_traceEntrypoints->m_traceCatch)(className,methodName,that,catchIndex,type,len,value);

       }
   #else
  -    static inline void traceCatch(const char *className, const char *methodName, int catchIndex,
  +    static inline void traceCatch(const char *className, const char *methodName, const
void* that, int catchIndex,
   		int type=TRACETYPE_UNKNOWN, unsigned len=0, void *value=0) {
  -        traceCatchInternal(className,methodName,catchIndex,type,len,value);
  +        traceCatchInternal(className,methodName,that,catchIndex,type,len,value);
       }
   #endif
  -	static void traceCatchInternal(const char *className, const char *methodName, int catchIndex,
  +	static void traceCatchInternal(const char *className, const char *methodName, const void*
that, int catchIndex,
   		int type=TRACETYPE_UNKNOWN, unsigned len=0, void *value=0);
         /**
          * Closes the trace file
  
  
  
  1.8       +18 -0     ws-axis/c/tools/org/apache/axis/tools/trace/Tracer.java
  
  Index: Tracer.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/tools/org/apache/axis/tools/trace/Tracer.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Tracer.java	17 Feb 2005 10:49:02 -0000	1.7
  +++ Tracer.java	3 Mar 2005 09:59:39 -0000	1.8
  @@ -187,6 +187,10 @@
   				"Expecting to return void from a method that returns a value: "
   					+ signature.toString());
   
  +		String that = "NULL";
  +		if (headers.isInstanceMethod(signature))
  +			that = "this";
  +
   		// Enclose the printf/return in {} in case if/then doesn't have {}
   		String line = "\t{\n";
   		line += "\t\t" + hashifdef;
  @@ -199,6 +203,8 @@
   			+ ", \""
   			+ signature.getMethodName()
   			+ "\", "
  +			+ that
  +			+ ", "
   			+ returnIndex
   			+ ");\t"
   			+ SIGNATURE
  @@ -227,6 +233,10 @@
   				"Expecting to return a value from a method that returns void: "
   					+ signature.toString());
   
  +		String that = "NULL";
  +		if (headers.isInstanceMethod(signature))
  +			that = "this";
  +
   		// Enclose the printf/return in {} in case if/then doesn't have {}
   		// Copy the return value into a local called traceRet in case the
   		// return value has side-effects such as "return i++;" or "return func();"
  @@ -251,6 +261,8 @@
   			+ ", \""
   			+ signature.getMethodName()
   			+ "\", "
  +			+ that
  +			+ ", "
   			+ returnIndex
   			+ getTypeParms(signature.getReturnType(), true)
   			+ ");\t"
  @@ -270,6 +282,10 @@
   		if (!signature.traceable())
   			return;
   
  +		String that = "NULL";
  +		if (headers.isInstanceMethod(signature))
  +			that = "this";
  +
   		String line =
   			"\n"
   				+ "\t"
  @@ -286,6 +302,8 @@
   				+ ", \""
   				+ signature.getMethodName()
   				+ "\", "
  +				+ that
  +				+ ", "
   				+ catchIndex
   				+ getTypeParms(value);
   		line += ");\t" + SIGNATURE + "\n";
  
  
  

Mime
View raw message