# HG changeset patch
# User laurent
# Date 1307634477 -7200
# Node ID 5b687021c6e774c4d27de73d5b3179b6a254469e
# Parent  baa7a1585585144a46d2f86d3fdef94760a22684
Fix bug in debugging variable list compilation with structure and array disabling

diff -r baa7a1585585 -r 5b687021c6e7 stage4/generate_c/generate_var_list.cc
--- a/stage4/generate_c/generate_var_list.cc	Wed Jun 08 18:34:53 2011 +0200
+++ b/stage4/generate_c/generate_var_list.cc	Thu Jun 09 17:47:57 2011 +0200
@@ -208,6 +208,14 @@
     }
     
     void declare_variable(symbol_c *symbol) {
+      // Arrays and structures are not supported in debugging
+      switch (this->current_var_type_category) {
+      	case array_vtc:
+      	case structure_vtc:
+          return;
+      	default:
+      	  break;
+      }
       print_var_number();
       s4o.print(";");
       switch (this->current_var_type_category) {
@@ -367,7 +375,7 @@
       update_var_type_symbol(symbol->array_spec_init);
       
       this->current_var_type_category = array_vtc;
-      //declare_variables(symbol->var1_list);
+      declare_variables(symbol->var1_list);
     
       /* Values no longer in scope, and therefore no longer used.
        * Make an effort to keep them set to NULL when not in use
@@ -392,7 +400,8 @@
       update_var_type_symbol(symbol->initialized_structure);
     
       /* now to produce the c equivalent... */
-      //declare_variables(symbol->var1_list);
+      this->current_var_type_category = structure_vtc;
+      declare_variables(symbol->var1_list);
     
       /* Values no longer in scope, and therefore no longer used.
        * Make an effort to keep them set to NULL when not in use