commit 9c100359572badd9f8a76b6bdf366d314bc535cc from: Neels Hofmeyr date: Fri Nov 06 02:16:10 2020 UTC debug fu commit - 80a9b435207b9beebd238b7b33351332c610b28f commit + 9c100359572badd9f8a76b6bdf366d314bc535cc blob - 86b1bbb63e60ea789931d5e79ed1e232c0154d59 blob + 3f49a40f060662d1247a94fc27792f43e8d88ae8 --- lib/diff_main.c +++ lib/diff_main.c @@ -547,8 +547,26 @@ diff_run_algo(const struct diff_algo_config *algo_conf * result, and subsequent solved chunks on this level are then appended * to result afterwards. */ int i; +#if DEBUG + debug("temp_result: %d\n", state->temp_result.len); for (i = 0; i < state->temp_result.len; i++) { struct diff_chunk *c = &state->temp_result.head[i]; + enum diff_chunk_type t = diff_chunk_type(c); + + debug("[%lu] %s lines L%d R%d @L %lld @R %lld\n", + i, + (t == CHUNK_MINUS ? "minus" : + (t == CHUNK_PLUS ? "plus" : + (t == CHUNK_SAME ? "same" : "?"))), + c->left_count, + c->right_count, + (long long)(c->left_start ? diff_atom_root_idx(c->left_start->root, c->left_start) : -1LL), + (long long)(c->right_start ? diff_atom_root_idx(c->right_start->root, c->right_start) : -1LL)); + } +#endif + + for (i = 0; i < state->temp_result.len; i++) { + struct diff_chunk *c = &state->temp_result.head[i]; if (c->solved) { debug("from diff_run_algo()\n"); diff_state_add_solved_chunk(state, c); @@ -573,6 +591,7 @@ diff_run_algo(const struct diff_algo_config *algo_conf if (rc != DIFF_RC_OK) goto return_rc; } + debug("End of temp_result: %d\n", state->temp_result.len); rc = DIFF_RC_OK; return_rc: