User forums > General (but related to Code::Blocks)

Debuger - confusion (F7 does not work)

<< < (3/3)

wever:
>list 155
150 while (*s != '\0')
151 {
152 if (*s != separator)
153     {
154     if ( *s == skipChar )
155         skip = true;
156     else {
157   
158   
159         if ( !skip ) {

>list
169       if ( *(s+1) < 'b' || *(s+1) > 't' ) {
170           printf("Incorrect character in task file: %.20s\n", s);
171           abort_parseTaskFile(w,s,-1);
172           }
173       else {
174           blockDepthParser(w, &s, goOn);
175           }
176      //printf("OH YES");
177       } // next char is not \0
178 } // if dip found

wever:
Small change to the code:

--- Code: ---    while (*s != '\0')
    {
    if (*s != separator)
        {
        if ( *s == skipChar )
            skip = true;
        else {

            if ( !skip ) {
            // The >dip> section is parsed only once (next chars are skipped till next dip is found)
            if ( *s == dip ) {
                if (*(s+1) > 35){
                    if ( *(s+1) < 'b' || *(s+1) > 't' ) {
                        // printf("Incorrect character in task file: %.20s\n", s);
                        // abort_parseTaskFile(w,s,-1);
                        }
                    else {
                        blockDepthParser(w, &s, goOn);
                        }
                   //printf("OH YES");
                    } // next char is not \0
              } // if dip found
            } // if !skip


            } // *s != skipChar
        } // parsing a line
--- End code ---

Notice comments:
// printf("Incorrect character in task file: %.20s\n", s);
// abort_parseTaskFile(w,s,-1);
This times it will correctly jump to next line 238:

--- Code: ---    ++s;
    } // end while

--- End code ---

Also notice that the abort_parseTaskFile(w,s,-1); is not executed when I run debugger (as expected).

oBFusCATed:
OK, now try running gdb from a cmd.exe window to confirm this is gdb or gcc problem.

wever:
I don't know how to do that. How to run gdb from cmd?

oBFusCATed:
Start cmd.exe or any other command prompt in windows then follow the log from the debugger. All commands are there. Start with the minimal set args, break, run, next, continue, etc.

Also there are tons of beginners tutorials out there.

Navigation

[0] Message Index

[*] Previous page

Go to full version