I am trying to debug c in eclipse with the next code:
void print_clause(SAT_clause * c) {
int l_index;
printf("(");
for (l_index = 0; l_index < c->literal_count; l_index++) {
print_literal(c->literal_arr[l_index]);
if(l_index != c->literal_count - 1){
printf(" v ");
}
}
printf(")");
}
but each time I get to the "printf("(");"
(the first print in this function) I get the next message in the console :
(*stopped,reason="end-stepping-range"...
and than I can't step anymore. I assume this is dbg
message that eclipse doesn't parse very well. I read somewhere that I need to add \n
in the end of the printf
function - that did work but I need the printf
without the \n
in the end. If I run in release mode - the printing is OK.
What am I doing wrong and how can I continue stepping after the printf
?
UPDATE Ok - I found out what is causing this behavior (but I still have a problem) - it is because of this link : printf not printing on console . I added the setbuf(stdout, NULL); for enable printing in debug but than I can't step. Still if I remove this setbuf(stdout, NULL); I can't see the printf in debug mode because of the buffer (but I can continue stepping). any suggestions ?