This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[BC] Patch: FYI: add another debug function


I'm checking this in on the BC branch.
This makes it simpler to print an object's static fields from gdb.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* gnu/gcj/util/Debug.java (Debug(int,boolean)): New constructor.
	* gnu/gcj/util/natDebug.cc (_Jv_StaticDeepDebug): New function.

Index: gnu/gcj/util/Debug.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/gcj/util/Attic/Debug.java,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 Debug.java
--- gnu/gcj/util/Debug.java 16 Apr 2004 12:49:57 -0000 1.1.2.1
+++ gnu/gcj/util/Debug.java 5 Oct 2004 21:43:37 -0000
@@ -38,17 +38,22 @@
 	this(writer, 0, 10, false);
     }
 
-    Debug(int maxdepth)
+    Debug(int maxdepth, boolean printStaticFields)
     {
 	this(new PrintStream
 	     (new FileOutputStream(FileDescriptor.err), true), 
 	     maxdepth, 
-	     maxdepth > 0 ? 1000 : 10, false);
+	     maxdepth > 0 ? 1000 : 10, printStaticFields);
+    }
+
+    Debug(int maxdepth)
+    {
+        this(maxdepth, false);
     }
 
     Debug()
     {
-	this(0);
+        this(0, false);
     }
   
     private final void indent()
Index: gnu/gcj/util/natDebug.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/gcj/util/Attic/natDebug.cc,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 natDebug.cc
--- gnu/gcj/util/natDebug.cc 16 Apr 2004 12:49:57 -0000 1.1.2.1
+++ gnu/gcj/util/natDebug.cc 5 Oct 2004 21:43:37 -0000
@@ -109,3 +109,10 @@
 {
   (new ::gnu::gcj::util::Debug (depth))->write ((jobject)p);
 }
+
+extern "C"
+void
+_Jv_StaticDeepDebug (void *p, int depth)
+{
+  (new ::gnu::gcj::util::Debug (depth, true))->write ((jobject)p);
+}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]