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]

[gcjx] Patch: FYI: better debug info


I'm checking this in on the gcjx branch.

It turns out you must set TREE_USED on a BLOCK in order for debug
info to be generated for the variables in that block.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* tree.hh (tree_generator::make_block): Declare.
	* tree.cc (make_block): New method.
	(visit_method): Use it.
	(build_jni_stub): Likewise.
	(visit_block): Likewise.
	(visit_catch): Likewise.
	(visit_for_enhanced): Likewise.
	(visit_for): Likewise.

Index: tree.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Attic/tree.cc,v
retrieving revision 1.1.2.66
diff -u -r1.1.2.66 tree.cc
--- tree.cc 12 Oct 2005 00:48:06 -0000 1.1.2.66
+++ tree.cc 12 Oct 2005 15:17:37 -0000
@@ -119,6 +119,15 @@
   return result;
 }
 
+tree
+tree_generator::make_block ()
+{
+  tree b = make_node (BLOCK);
+  // This determines 
+  TREE_USED (b) = 1;
+  return b;
+}
+
 
 
 void
@@ -139,7 +148,7 @@
       if (! meth->static_p ())
 	this_tree = DECL_ARGUMENTS (method_tree);
 
-      current_block = make_node (BLOCK);
+      current_block = make_block ();
       BLOCK_SUPERCONTEXT (current_block) = method_tree;
       DECL_INITIAL (method_tree) = current_block;
 
@@ -200,7 +209,7 @@
 tree
 tree_generator::build_jni_stub ()
 {
-  current_block = make_node (BLOCK);
+  current_block = make_block ();
   BLOCK_SUPERCONTEXT (current_block) = method_tree;
   DECL_INITIAL (method_tree) = current_block;
 
@@ -446,7 +455,7 @@
 			     const std::list<ref_stmt> &statements)
 {
   // Create a new block for the body.
-  save_tree saver (current_block, make_node (BLOCK));
+  save_tree saver (current_block, make_block ());
   BLOCK_SUPERCONTEXT (current_block) = saver.get ();
 
   tree body = transform_list (statements);
@@ -480,7 +489,7 @@
 			     const ref_block &body)
 {
   // Create a new block for the body.
-  save_tree saver (current_block, make_node (BLOCK));
+  save_tree saver (current_block, make_block ());
   BLOCK_SUPERCONTEXT (current_block) = saver.get ();
 
   // Make a new variable and link it in.
@@ -602,7 +611,7 @@
   target_map[fstmt] = std::make_pair (update_tree, done_tree);
 
   // Push a new block around the loop.
-  save_tree saver (current_block, make_node (BLOCK));
+  save_tree saver (current_block, make_block ());
   BLOCK_SUPERCONTEXT (current_block) = saver.get ();
 
   tree body_tree = alloc_stmt_list ();
@@ -764,7 +773,7 @@
   tree done_tree = build_label ();
   target_map[fstmt] = std::make_pair (update_tree, done_tree);
 
-  save_tree saver (current_block, make_node (BLOCK));
+  save_tree saver (current_block, make_block ());
   BLOCK_SUPERCONTEXT (current_block) = saver.get ();
 
   tree result = alloc_stmt_list ();
Index: tree.hh
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Attic/tree.hh,v
retrieving revision 1.1.2.19
diff -u -r1.1.2.19 tree.hh
--- tree.hh 12 Oct 2005 00:48:06 -0000 1.1.2.19
+++ tree.hh 12 Oct 2005 15:17:37 -0000
@@ -133,6 +133,7 @@
   tree build_array_reference (tree, tree, tree, bool = true);
   tree build_exception_object_ref (tree);
   tree build_label ();
+  tree make_block ();
   tree build_arguments (const std::list<ref_expression> &, tree &);
 
   void stringbuffer_append (model_expression *, tree &, model_class *,


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