Commits

Shlomi Fish  committed c0d714a

Add some DEBUG_OUT debugging code.

This adds a print trace of the traversed states to the STDOUT. It is off
by default.

I needed it to debug the bug from the previous commit.

git-svn-id: file:///home/shlomif/Backup/svn-dumps/google-code/svnsync-repos/fc-solve/fc-solve/trunk@4535 e7e8a897-7ba4-4ee7-b36f-f4c66519b19a

  • Participants
  • Parent commits 3d8a126

Comments (0)

Files changed (1)

File fc-solve/source/dbm_solver.c

     fcs_compact_allocator_t derived_list_allocator;
     fc_solve_delta_stater_t * delta_stater;
     fcs_state_keyval_pair_t state;
+#ifdef DEBUG_OUT
+    fcs_state_locs_struct_t locs;
+#endif
     DECLARE_IND_BUF_T(indirect_stacks_buffer)
 
     arg = (thread_arg_t *)void_arg;
     derived_list_recycle_bin = NULL;
     derived_list = NULL;
 
+#ifdef DEBUG_OUT
+    fc_solve_init_locs(&locs);
+#endif
     while (1)
     {
         /* First of all extract an item. */
             indirect_stacks_buffer
         );
 
+        /* A section for debugging. */
+#ifdef DEBUG_OUT
+        {
+            char * state_str;
+            state_str = fc_solve_state_as_string(
+                &(state.s),
+                &(state.info),
+                &locs,
+                2,
+                8,
+                1,
+                1,
+                0,
+                1
+            );
+
+            printf("<<<\n%s>>>\n", state_str);
+            free(state_str);
+        }
+#endif
+
         if (instance_solver_thread_calc_derived_states(
             &state,
             &(item->key),