Author Topic: Debuger - confusion (F7 does not work)  (Read 8490 times)

Offline wever

  • Multiple posting newcomer
  • *
  • Posts: 49
Debuger - confusion (F7 does not work)
« on: April 19, 2015, 08:19:57 pm »
I copy/paste the problem here because it looks it could be problem of the debugger (v 13.12 ):

It looks like the IDE have used "Continue Debuging" (F8) instead of "Next line" (F7).

It originally looked like problem with if .. else .. command

When I debug the code, so on line 4 it breaks, then I press f8 to jump after the else block. Now as it is it is OK, it works. But if I remove the line with printf("OH YES;"); ... so it jumps directly onto the line with blockDepthParser(w, &s, goOn); (there is breakpoint) ...


Code
    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 ) {
                inBlockDepth++;
                // prev  = s - 1;
                if ( *(s - 1) == '+')
                    type = 'i';
                else if ( *(s - 1) == '-')
                    type = 'e';
                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); // B) It will jump here!
                        }
                    printf("OH YES;"); // A) I REMOVE THIS
                    } // next char is not \0
              } // if dip found
            } // if !skip


            } // *s != skipChar
        } // parsing a line


blockDepthParser is inline function:
Code
inline int blockDepthParser(WRAPPER_t * w, char **s, bool 
goOn);
Code
inline int blockDepthParser(WRAPPER_t * w, char **s, bool goOn){
    int * SSNo = &(w->task.temp.sub_square_no);
    printf("Sub-square number: %d\n",........No);
    if (goOn)
        ++(........No);
    return 0;
}

So this is very unusual for me and need a help what could cause it and how to solve the problem.

Warnings related to the function I run the code from:
In function 'depthInStringExt':
warning: unused variable 'zoom' [-Wunused-variable]
warning: unused variable 'origin' [-Wunused-variable]

Note: the function with the code above is called from while loop. It looks like the IDE have used "Continue Debuging" (F8) instead of "Next line" (F7). I can confirm it because I add new breakpoint after the else branch. But why this happened? Any explanation for this mystery?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Debuger - confusion (F7 does not work)
« Reply #1 on: April 19, 2015, 08:35:31 pm »
First thing you need to do is: go to the settings of the debugger and enable full logging, then paste the log here using code tags.

Also make sure you're building without optimizations; debug symbols should be enabled and symbols stripping should be disabled.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline wever

  • Multiple posting newcomer
  • *
  • Posts: 49
Re: Debuger - confusion (F7 does not work)
« Reply #2 on: April 19, 2015, 10:29:10 pm »
It's very long, but the problem is in task_fnc.c. The other files contains still many of workings, so skip layers_fnc etc.

Code

-------------- Clean: Debug in jpeg-trubo_test (compiler: GNU GCC Compiler)---------------

Cleaned "jpeg-trubo_test - Debug"

-------------- Build: Debug in jpeg-trubo_test (compiler: GNU GCC Compiler)---------------

mingw32-gcc.exe -Wall -g -Wunused-variable -Wunused-but-set-variable -Wunused-function -Ic:\libjpeg-turbo\libjpeg-turbo-gcc\include -Ic:\th\pthreads-w32-2-9-1\Pre-built.2\include -Ic:\timer\refu -Ic:\timer\refu\Time\ -Ic:\t\jpeg-trubo_test -Ic:\imglib\libpng\libpng1237\include -Ic:\imglib\zlib128-dll\include -Ic:\c\SDL-1.2.15-lib-MiGW32\include\SDL -c c:\t\args.c -o obj\Debug\args.o
c:\t\args.c: In function 'parseArgs':
c:\t\args.c:53:11: warning: implicit declaration of function 'parseColorFile' [-Wimplicit-function-declaration]
mingw32-gcc.exe -Wall -g -Wunused-variable -Wunused-but-set-variable -Wunused-function -Ic:\libjpeg-turbo\libjpeg-turbo-gcc\include -Ic:\th\pthreads-w32-2-9-1\Pre-built.2\include -Ic:\timer\refu -Ic:\timer\refu\Time\ -Ic:\t\jpeg-trubo_test -Ic:\imglib\libpng\libpng1237\include -Ic:\imglib\zlib128-dll\include -Ic:\c\SDL-1.2.15-lib-MiGW32\include\SDL -c c:\t\bmp_conversions.c -o obj\Debug\bmp_conversions.o
mingw32-gcc.exe -Wall -g -Wunused-variable -Wunused-but-set-variable -Wunused-function -Ic:\libjpeg-turbo\libjpeg-turbo-gcc\include -Ic:\th\pthreads-w32-2-9-1\Pre-built.2\include -Ic:\timer\refu -Ic:\timer\refu\Time\ -Ic:\t\jpeg-trubo_test -Ic:\imglib\libpng\libpng1237\include -Ic:\imglib\zlib128-dll\include -Ic:\c\SDL-1.2.15-lib-MiGW32\include\SDL -c c:\t\bmpfile.c -o obj\Debug\bmpfile.o
c:\t\bmpfile.c: In function 'bmp_save':
c:\t\bmpfile.c:971:10: warning: variable 'bytes_per_pixel' set but not used [-Wunused-but-set-variable]
c:\t\bmpfile.c: At top level:
c:\t\bmpfile.c:215:1: warning: 'bmp_create_grayscale_color_table' defined but not used [-Wunused-function]
mingw32-gcc.exe -Wall -g -Wunused-variable -Wunused-but-set-variable -Wunused-function -Ic:\libjpeg-turbo\libjpeg-turbo-gcc\include -Ic:\th\pthreads-w32-2-9-1\Pre-built.2\include -Ic:\timer\refu -Ic:\timer\refu\Time\ -Ic:\t\jpeg-trubo_test -Ic:\imglib\libpng\libpng1237\include -Ic:\imglib\zlib128-dll\include -Ic:\c\SDL-1.2.15-lib-MiGW32\include\SDL -c c:\t\colors_fnc_1.c -o obj\Debug\colors_fnc_1.o
c:\t\colors_fnc_1.c: In function 'parseColorFile':
c:\t\colors_fnc_1.c:104:5: warning: passing argument 1 of 'abort_parseColorFile' from incompatible pointer type [enabled by default]
c:\t\colors_fnc_1.c:66:6: note: expected 'struct WRAPPER_t *' but argument is of type 'struct COLOR_FILE_t **'
c:\t\colors_fnc_1.c:140:25: warning: passing argument 1 of 'abort_parseColorFile' from incompatible pointer type [enabled by default]
c:\t\colors_fnc_1.c:66:6: note: expected 'struct WRAPPER_t *' but argument is of type 'struct COLOR_FILE_t **'
c:\t\colors_fnc_1.c:248:41: warning: passing argument 1 of 'abort_parseColorFile' from incompatible pointer type [enabled by default]
c:\t\colors_fnc_1.c:66:6: note: expected 'struct WRAPPER_t *' but argument is of type 'struct COLOR_FILE_t **'
c:\t\colors_fnc_1.c:393:45: warning: implicit declaration of function 'comma2dot' [-Wimplicit-function-declaration]
c:\t\colors_fnc_1.c:393:52: warning: assignment makes pointer from integer without a cast [enabled by default]
c:\t\colors_fnc_1.c:398:52: warning: assignment makes pointer from integer without a cast [enabled by default]
c:\t\colors_fnc_1.c:383:39: warning: enumeration value 'no_attr_fc' not handled in switch [-Wswitch]
c:\t\colors_fnc_1.c:467:17: warning: passing argument 1 of 'abort_parseColorFile' from incompatible pointer type [enabled by default]
c:\t\colors_fnc_1.c:66:6: note: expected 'struct WRAPPER_t *' but argument is of type 'struct COLOR_FILE_t **'
c:\t\colors_fnc_1.c:473:13: warning: passing argument 1 of 'abort_parseColorFile' from incompatible pointer type [enabled by default]
c:\t\colors_fnc_1.c:66:6: note: expected 'struct WRAPPER_t *' but argument is of type 'struct COLOR_FILE_t **'
c:\t\colors_fnc_1.c:487:18: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
c:\t\colors_fnc_1.c:511:13: warning: passing argument 1 of 'abort_parseColorFile' from incompatible pointer type [enabled by default]
c:\t\colors_fnc_1.c:66:6: note: expected 'struct WRAPPER_t *' but argument is of type 'struct COLOR_FILE_t **'
c:\t\colors_fnc_1.c:120:40: warning: unused variable 'argTok' [-Wunused-variable]
c:\t\colors_fnc_1.c:118:16: warning: unused variable 'sarg' [-Wunused-variable]
c:\t\colors_fnc_1.c:99:29: warning: unused variable 'cid' [-Wunused-variable]
c:\t\colors_fnc_1.c:99:25: warning: variable 'rid' set but not used [-Wunused-but-set-variable]
c:\t\colors_fnc_1.c:99:20: warning: variable 'tmpi' set but not used [-Wunused-but-set-variable]
c:\t\colors_fnc_1.c:99:16: warning: variable 'arg' set but not used [-Wunused-but-set-variable]
c:\t\colors_fnc_1.c:85:45: warning: unused variable 'result' [-Wunused-variable]
c:\t\colors_fnc_1.c:84:49: warning: unused variable 'argLastToken' [-Wunused-variable]
mingw32-gcc.exe -Wall -g -Wunused-variable -Wunused-but-set-variable -Wunused-function -Ic:\libjpeg-turbo\libjpeg-turbo-gcc\include -Ic:\th\pthreads-w32-2-9-1\Pre-built.2\include -Ic:\timer\refu -Ic:\timer\refu\Time\ -Ic:\t\jpeg-trubo_test -Ic:\imglib\libpng\libpng1237\include -Ic:\imglib\zlib128-dll\include -Ic:\c\SDL-1.2.15-lib-MiGW32\include\SDL -c c:\t\debug_fnc.c -o obj\Debug\debug_fnc.o
mingw32-gcc.exe -Wall -g -Wunused-variable -Wunused-but-set-variable -Wunused-function -Ic:\libjpeg-turbo\libjpeg-turbo-gcc\include -Ic:\th\pthreads-w32-2-9-1\Pre-built.2\include -Ic:\timer\refu -Ic:\timer\refu\Time\ -Ic:\t\jpeg-trubo_test -Ic:\imglib\libpng\libpng1237\include -Ic:\imglib\zlib128-dll\include -Ic:\c\SDL-1.2.15-lib-MiGW32\include\SDL -c c:\t\files.c -o obj\Debug\files.o
mingw32-gcc.exe -Wall -g -Wunused-variable -Wunused-but-set-variable -Wunused-function -Ic:\libjpeg-turbo\libjpeg-turbo-gcc\include -Ic:\th\pthreads-w32-2-9-1\Pre-built.2\include -Ic:\timer\refu -Ic:\timer\refu\Time\ -Ic:\t\jpeg-trubo_test -Ic:\imglib\libpng\libpng1237\include -Ic:\imglib\zlib128-dll\include -Ic:\c\SDL-1.2.15-lib-MiGW32\include\SDL -c c:\t\fnc.c -o obj\Debug\fnc.o
c:\t\fnc.c: In function 'printFile':
c:\t\fnc.c:519:3: warning: implicit declaration of function 'get_fsize' [-Wimplicit-function-declaration]
mingw32-gcc.exe -Wall -g -Wunused-variable -Wunused-but-set-variable -Wunused-function -Ic:\libjpeg-turbo\libjpeg-turbo-gcc\include -Ic:\th\pthreads-w32-2-9-1\Pre-built.2\include -Ic:\timer\refu -Ic:\timer\refu\Time\ -Ic:\t\jpeg-trubo_test -Ic:\imglib\libpng\libpng1237\include -Ic:\imglib\zlib128-dll\include -Ic:\c\SDL-1.2.15-lib-MiGW32\include\SDL -c c:\t\get_fnc.c -o obj\Debug\get_fnc.o
c:\t\get_fnc.c: In function 'getAction_str':
c:\t\get_fnc.c:10:5: warning: excess elements in array initializer [enabled by default]
c:\t\get_fnc.c:10:5: warning: (near initialization for '(anonymous)') [enabled by default]
mingw32-gcc.exe -Wall -g -Wunused-variable -Wunused-but-set-variable -Wunused-function -Ic:\libjpeg-turbo\libjpeg-turbo-gcc\include -Ic:\th\pthreads-w32-2-9-1\Pre-built.2\include -Ic:\timer\refu -Ic:\timer\refu\Time\ -Ic:\t\jpeg-trubo_test -Ic:\imglib\libpng\libpng1237\include -Ic:\imglib\zlib128-dll\include -Ic:\c\SDL-1.2.15-lib-MiGW32\include\SDL -c c:\t\jpeglib_conversion.c -o obj\Debug\jpeglib_conversion.o
c:\t\jpeglib_conversion.c: In function 'read_jpg_file':
c:\t\jpeglib_conversion.c:118:9: warning: statement with no effect [-Wunused-value]
c:\t\jpeglib_conversion.c: In function 'prepare_write_jpg_file':
c:\t\jpeglib_conversion.c:255:5: warning: passing argument 1 of 'jpeg_std_error' from incompatible pointer type [enabled by default]
In file included from c:\t\data_types.h:4:0,
                 from c:\t\jpeglib_conversion.h:4,
                 from c:\t\jpeglib_conversion.c:17:
c:\libjpeg-turbo\libjpeg-turbo-gcc\include/jpeglib.h:895:33: note: expected 'struct jpeg_error_mgr *' but argument is of type 'struct my_error_mgr *'
mingw32-gcc.exe -Wall -g -Wunused-variable -Wunused-but-set-variable -Wunused-function -Ic:\libjpeg-turbo\libjpeg-turbo-gcc\include -Ic:\th\pthreads-w32-2-9-1\Pre-built.2\include -Ic:\timer\refu -Ic:\timer\refu\Time\ -Ic:\t\jpeg-trubo_test -Ic:\imglib\libpng\libpng1237\include -Ic:\imglib\zlib128-dll\include -Ic:\c\SDL-1.2.15-lib-MiGW32\include\SDL -c c:\t\layers_fnc_1.c -o obj\Debug\layers_fnc_1.o
c:\t\layers_fnc_1.c: In function 'parseLayerFile':
c:\t\layers_fnc_1.c:97:3: warning: passing argument 1 of 'abort_parseLayerFile' from incompatible pointer type [enabled by default]
c:\t\layers_fnc_1.c:46:6: note: expected 'struct WRAPPER_t *' but argument is of type 'struct LAYER_FILE_t **'
c:\t\layers_fnc_1.c:184:21: warning: passing argument 1 of 'abort_parseLayerFile' from incompatible pointer type [enabled by default]
c:\t\layers_fnc_1.c:46:6: note: expected 'struct WRAPPER_t *' but argument is of type 'struct LAYER_FILE_t **'
c:\t\layers_fnc_1.c:194:21: warning: passing argument 1 of 'abort_parseLayerFile' from incompatible pointer type [enabled by default]
c:\t\layers_fnc_1.c:46:6: note: expected 'struct WRAPPER_t *' but argument is of type 'struct LAYER_FILE_t **'
c:\t\layers_fnc_1.c:238:13: warning: passing argument 1 of 'abort_parseLayerFile' from incompatible pointer type [enabled by default]
c:\t\layers_fnc_1.c:46:6: note: expected 'struct WRAPPER_t *' but argument is of type 'struct LAYER_FILE_t **'
c:\t\layers_fnc_1.c:299:33: warning: passing argument 1 of 'abort_parseLayerFile' from incompatible pointer type [enabled by default]
c:\t\layers_fnc_1.c:46:6: note: expected 'struct WRAPPER_t *' but argument is of type 'struct LAYER_FILE_t **'
c:\t\layers_fnc_1.c:305:33: warning: format '%d' expects a matching 'int' argument [-Wformat]
c:\t\layers_fnc_1.c:306:33: warning: passing argument 1 of 'abort_parseLayerFile' from incompatible pointer type [enabled by default]
c:\t\layers_fnc_1.c:46:6: note: expected 'struct WRAPPER_t *' but argument is of type 'struct LAYER_FILE_t **'
c:\t\layers_fnc_1.c:337:33: warning: passing argument 1 of 'abort_parseLayerFile' from incompatible pointer type [enabled by default]
c:\t\layers_fnc_1.c:46:6: note: expected 'struct WRAPPER_t *' but argument is of type 'struct LAYER_FILE_t **'
c:\t\layers_fnc_1.c:360:25: warning: passing argument 1 of 'abort_parseLayerFile' from incompatible pointer type [enabled by default]
c:\t\layers_fnc_1.c:46:6: note: expected 'struct WRAPPER_t *' but argument is of type 'struct LAYER_FILE_t **'
c:\t\layers_fnc_1.c:372:31: warning: passing argument 1 of 'abort_parseLayerFile' from incompatible pointer type [enabled by default]
c:\t\layers_fnc_1.c:46:6: note: expected 'struct WRAPPER_t *' but argument is of type 'struct LAYER_FILE_t **'
c:\t\layers_fnc_1.c:411:29: warning: passing argument 1 of 'test_lid_exists' from incompatible pointer type [enabled by default]
c:\t\layers_fnc_1.c:4:6: note: expected 'struct LAYER_FILE_t *' but argument is of type 'struct NEW_LAYER_REQUEST_t **'
c:\t\layers_fnc_1.c:415:33: warning: passing argument 1 of 'abort_parseLayerFile' from incompatible pointer type [enabled by default]
c:\t\layers_fnc_1.c:46:6: note: expected 'struct WRAPPER_t *' but argument is of type 'struct LAYER_FILE_t **'
c:\t\layers_fnc_1.c:424:29: warning: passing argument 1 of 'test_lid_exists' from incompatible pointer type [enabled by default]
c:\t\layers_fnc_1.c:4:6: note: expected 'struct LAYER_FILE_t *' but argument is of type 'struct NEW_LAYER_REQUEST_t **'
c:\t\layers_fnc_1.c:465:29: warning: passing argument 1 of 'test_lid_exists' from incompatible pointer type [enabled by default]
c:\t\layers_fnc_1.c:4:6: note: expected 'struct LAYER_FILE_t *' but argument is of type 'struct NEW_LAYER_REQUEST_t **'
c:\t\layers_fnc_1.c:469:33: warning: passing argument 1 of 'abort_parseLayerFile' from incompatible pointer type [enabled by default]
c:\t\layers_fnc_1.c:46:6: note: expected 'struct WRAPPER_t *' but argument is of type 'struct LAYER_FILE_t **'
c:\t\layers_fnc_1.c:478:29: warning: statement with no effect [-Wunused-value]
c:\t\layers_fnc_1.c:503:37: warning: passing argument 1 of 'setAction' from incompatible pointer type [enabled by default]
In file included from c:\t\layers_fnc_1.h:5:0,
                 from c:\t\layers_fnc_1.c:1:
c:\t\fnc.h:22:10: note: expected 'struct LAYER_COMMAND_REFS_t *' but argument is of type 'struct WRAPPER_t *'
c:\t\layers_fnc_1.c:506:37: warning: passing argument 1 of 'setEffect' from incompatible pointer type [enabled by default]
In file included from c:\t\layers_fnc_1.h:5:0,
                 from c:\t\layers_fnc_1.c:1:
c:\t\fnc.h:21:10: note: expected 'struct LAYER_COMMAND_REFS_t *' but argument is of type 'struct WRAPPER_t *'
c:\t\layers_fnc_1.c:509:37: warning: passing argument 1 of 'setFilter' from incompatible pointer type [enabled by default]
In file included from c:\t\layers_fnc_1.h:5:0,
                 from c:\t\layers_fnc_1.c:1:
c:\t\fnc.h:20:10: note: expected 'struct LAYER_COMMAND_REFS_t *' but argument is of type 'struct WRAPPER_t *'
c:\t\layers_fnc_1.c:543:25: warning: passing argument 1 of 'test_lid_exists' from incompatible pointer type [enabled by default]
c:\t\layers_fnc_1.c:4:6: note: expected 'struct LAYER_FILE_t *' but argument is of type 'struct NEW_LAYER_REQUEST_t **'
c:\t\layers_fnc_1.c:547:29: warning: passing argument 1 of 'abort_parseLayerFile' from incompatible pointer type [enabled by default]
c:\t\layers_fnc_1.c:46:6: note: expected 'struct WRAPPER_t *' but argument is of type 'struct LAYER_FILE_t **'
c:\t\layers_fnc_1.c:92:8: warning: variable 'HSV_default_buf' set but not used [-Wunused-but-set-variable]
c:\t\layers_fnc_1.c:91:8: warning: variable 'CMYK_default_buf' set but not used [-Wunused-but-set-variable]
c:\t\layers_fnc_1.c:78:12: warning: unused variable 'operation' [-Wunused-variable]
c:\t\layers_fnc_1.c:76:41: warning: variable 'operation_failed' set but not used [-Wunused-but-set-variable]
c:\t\layers_fnc_1.c:76:25: warning: variable 'square_bracket' set but not used [-Wunused-but-set-variable]
mingw32-gcc.exe -Wall -g -Wunused-variable -Wunused-but-set-variable -Wunused-function -Ic:\libjpeg-turbo\libjpeg-turbo-gcc\include -Ic:\th\pthreads-w32-2-9-1\Pre-built.2\include -Ic:\timer\refu -Ic:\timer\refu\Time\ -Ic:\t\jpeg-trubo_test -Ic:\imglib\libpng\libpng1237\include -Ic:\imglib\zlib128-dll\include -Ic:\c\SDL-1.2.15-lib-MiGW32\include\SDL -c c:\t\main.c -o obj\Debug\main.o
mingw32-gcc.exe -Wall -g -Wunused-variable -Wunused-but-set-variable -Wunused-function -Ic:\libjpeg-turbo\libjpeg-turbo-gcc\include -Ic:\th\pthreads-w32-2-9-1\Pre-built.2\include -Ic:\timer\refu -Ic:\timer\refu\Time\ -Ic:\t\jpeg-trubo_test -Ic:\imglib\libpng\libpng1237\include -Ic:\imglib\zlib128-dll\include -Ic:\c\SDL-1.2.15-lib-MiGW32\include\SDL -c c:\t\png_conversions.c -o obj\Debug\png_conversions.o
mingw32-gcc.exe -Wall -g -Wunused-variable -Wunused-but-set-variable -Wunused-function -Ic:\libjpeg-turbo\libjpeg-turbo-gcc\include -Ic:\th\pthreads-w32-2-9-1\Pre-built.2\include -Ic:\timer\refu -Ic:\timer\refu\Time\ -Ic:\t\jpeg-trubo_test -Ic:\imglib\libpng\libpng1237\include -Ic:\imglib\zlib128-dll\include -Ic:\c\SDL-1.2.15-lib-MiGW32\include\SDL -c c:\t\png_fnc.c -o obj\Debug\png_fnc.o
mingw32-gcc.exe -Wall -g -Wunused-variable -Wunused-but-set-variable -Wunused-function -Ic:\libjpeg-turbo\libjpeg-turbo-gcc\include -Ic:\th\pthreads-w32-2-9-1\Pre-built.2\include -Ic:\timer\refu -Ic:\timer\refu\Time\ -Ic:\t\jpeg-trubo_test -Ic:\imglib\libpng\libpng1237\include -Ic:\imglib\zlib128-dll\include -Ic:\c\SDL-1.2.15-lib-MiGW32\include\SDL -c c:\t\strings_fnc.c -o obj\Debug\strings_fnc.o

mingw32-gcc.exe -Wall -g -Wunused-variable -Wunused-but-set-variable -Wunused-function -Ic:\libjpeg-turbo\libjpeg-turbo-gcc\include -Ic:\th\pthreads-w32-2-9-1\Pre-built.2\include -Ic:\timer\refu -Ic:\timer\refu\Time\ -Ic:\t\jpeg-trubo_test -Ic:\imglib\libpng\libpng1237\include -Ic:\imglib\zlib128-dll\include -Ic:\c\SDL-1.2.15-lib-MiGW32\include\SDL -c c:\t\task_fnc.c -o obj\Debug\task_fnc.o
c:\t\task_fnc.c: In function 'depthInStringExt':
c:\t\task_fnc.c:87:12: warning: unused variable 'zoom' [-Wunused-variable]
c:\t\task_fnc.c:86:12: warning: unused variable 'origin' [-Wunused-variable]

c:\t\task_fnc.c: In function 'parseTaskFile':
c:\t\task_fnc.c:334:9: warning: implicit declaration of function 'str2chrs' [-Wimplicit-function-declaration]
c:\t\task_fnc.c:334:14: warning: assignment makes pointer from integer without a cast [enabled by default]
c:\t\task_fnc.c:246:7: warning: unused variable 'table_counts' [-Wunused-variable]
mingw32-gcc.exe -Wall -g -Wunused-variable -Wunused-but-set-variable -Wunused-function -Ic:\libjpeg-turbo\libjpeg-turbo-gcc\include -Ic:\th\pthreads-w32-2-9-1\Pre-built.2\include -Ic:\timer\refu -Ic:\timer\refu\Time\ -Ic:\t\jpeg-trubo_test -Ic:\imglib\libpng\libpng1237\include -Ic:\imglib\zlib128-dll\include -Ic:\c\SDL-1.2.15-lib-MiGW32\include\SDL -c c:\t\thread_fnc.c -o obj\Debug\thread_fnc.o
mingw32-g++.exe -Lc:\th\pthread-win\x86 -Lc:\timer\refu -Lc:\c\SDL-2.0.3-lib-MinGW\lib -Lc:\c\SDL-2.0.3-lib-MinGW\lib\x86 -o bin\Debug\t.exe obj\Debug\args.o obj\Debug\bmp_conversions.o obj\Debug\bmpfile.o obj\Debug\colors_fnc_1.o obj\Debug\debug_fnc.o obj\Debug\files.o obj\Debug\fnc.o obj\Debug\get_fnc.o obj\Debug\jpeglib_conversion.o obj\Debug\layers_fnc_1.o obj\Debug\main.o obj\Debug\png_conversions.o obj\Debug\png_fnc.o obj\Debug\strings_fnc.o obj\Debug\task_fnc.o obj\Debug\thread_fnc.o   c:\libjpeg-turbo\libjpeg-turbo-gcc\lib\libturbojpeg.dll.a c:\libjpeg-turbo\libjpeg-turbo-gcc\lib\libjpeg.dll.a c:\th\pthreads-w32-2-9-1\Pre-built.2\lib\libpthreadGC2.a c:\timer\refu\refu.dll c:\imglib\libpng\libpng1237\bin\libpng3.dll c:\imglib\libpng\libpng1237\bin\libpng12.dll c:\t\libpng3.dll c:\t\libpng12.dll
Output file is bin\Debug\t.exe with size 305.39 KB
Process terminated with status 0 (0 minute(s), 4 second(s))
0 error(s), 58 warning(s) (0 minute(s), 4 second(s))

The warnings you see I was not able to fix till now.

I see only the -g options enabled, where to find what I should enable?
I have no experiences with optimization.
« Last Edit: April 19, 2015, 10:37:51 pm by wever »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Debuger - confusion (F7 does not work)
« Reply #3 on: April 20, 2015, 03:06:37 am »
OK, this is the build log, now you'll have to paste the log from the debugger.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline wever

  • Multiple posting newcomer
  • *
  • Posts: 49
Re: Debuger - confusion (F7 does not work)
« Reply #4 on: April 20, 2015, 10:00:51 am »
Here is the debugger report, also very long
Code
                                                 Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: c:\libjpeg-turbo\libjpeg-turbo-gcc\texture-edit\jpeg-trubo_test\
Adding source dir: c:\libjpeg-turbo\libjpeg-turbo-gcc\texture-edit\jpeg-trubo_test\
Adding file: c:\libjpeg-turbo\libjpeg-turbo-gcc\texture-edit\jpeg-trubo_test\bin\Debug\t.exe
Changing directory to: c:\libjpeg-turbo\libjpeg-turbo-gcc/texture-edit/jpeg-trubo_test/.
Set variable: PATH=.;c:\th\pthread-win\x86;c:\timer\refu;c:\p\CodeBlocks_32bit\MinGW\bin;c:\p\CodeBlocks_32bit\MinGW;c:\e\IM-6.9.0-Q16;C:\Program Files\AMD APP\bin\x86;C:\Documents and Settings\Administrator\Dokumenty\AMD APP\bin\x86;C:\Program Files\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Common Files\Adobe\AGL;C:\Program Files\AMD APP\tools\AMD APP KernelAnalyzer 1.9;c:\p\MinGW\bin

[debug]Command-line: c:\p\CodeBlocks_32bit\MINGW\bin\gdb.exe -nx -fullname  -quiet  -args c:\libjpeg-turbo\libjpeg-turbo-gcc/texture-edit/jpeg-trubo_test/bin/Debug/t.exe
[debug]Working dir : c:\libjpeg-turbo\libjpeg-turbo-gcc\texture-edit\jpeg-trubo_test

Starting debugger: c:\p\CodeBlocks_32bit\MINGW\bin\gdb.exe -nx -fullname  -quiet  -args c:\libjpeg-turbo\libjpeg-turbo-gcc/texture-edit/jpeg-trubo_test/bin/Debug/t.exe
done

[debug]> set prompt >>>>>>cb_gdb:

Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints

[debug]Reading symbols from c:\libjpeg-turbo\libjpeg-turbo-gcc\texture-edit\jpeg-trubo_test\bin\Debug\t.exe...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.5
[debug]Copyright (C) 2012 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "i686-pc-mingw32".
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (GDB) 7.5

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Function "__cxa_throw" not defined.
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source c:\p\CodeBlocks_32bit\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]c:\p\CodeBlocks_32bit\share\codeblocks/scripts/stl-views-1.0.3.gdb: No such file or directory.
[debug]>>>>>>cb_gdb:
[debug]> directory c:\libjpeg-turbo\libjpeg-turbo-gcc/texture-edit/jpeg-trubo_test/
[debug]Source directories searched: c:\libjpeg-turbo\libjpeg-turbo-gcc/texture-edit/jpeg-trubo_test;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> set args -task task.tsk -colorfile colors.txt -r 15_{12354-9876}_{112233-998877}*.jpg -layers layers.cfg -rgb2cmyk rgb4.jpg output.jpg -rgb output_hsv.jpg output_rgb__.jpg -hsv test_source_RGB_high_quality.png output_hsv_.png
[debug]>>>>>>cb_gdb:
[debug]> break "c:\libjpeg-turbo\libjpeg-turbo-gcc/texture-edit/jpeg-trubo_test/task_fnc.c:174"
[debug]Breakpoint 2 at 0x40d38f: file c:\libjpeg-turbo\libjpeg-turbo-gcc\texture-edit\jpeg-trubo_test\task_fnc.c, line 174.
[debug]>>>>>>cb_gdb:
[debug]> break "c:\libjpeg-turbo\libjpeg-turbo-gcc/texture-edit/jpeg-trubo_test/task_fnc.c:155"
[debug]Breakpoint 3 at 0x40d38b: file c:\libjpeg-turbo\libjpeg-turbo-gcc\texture-edit\jpeg-trubo_test\task_fnc.c, line 155.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: c:\libjpeg-turbo\libjpeg-turbo-gcc\texture-edit\jpeg-trubo_test\bin\Debug\t.exe -task task.tsk -colorfile colors.txt -r 15_{12354-9876}_{112233-998877}*.jpg -layers layers.cfg -rgb2cmyk rgb4.jpg output.jpg -rgb output_hsv.jpg output_rgb__.jpg -hsv test_source_RGB_high_quality.png output_hsv_.png

Child process PID: 2120

[debug][New Thread 2120.0x79c]
[debug]Breakpoint 3, depthInStringExt (w=0x3e28d8, s=0x3e45de "# celý čtverec 4,2 v zoomu 3\n3.3.2->l>r # čtverec 3,2 v zoomu 3 kromě horních dvou čtverců v zoomu  4\n3.3.2->l # čtverec 3,2 v zoomu 3 kromě horních dvou čtverců v zoomu  4\n3.3.3+>tr# ze čtverce 3,3 v zoomu 3 se zahrne pouze roh vpravo nahoře (zoom 4)\n3.4.3+>t # ze čtverce 4,3 v zoomu 3 se zahrnou pouze dva čtverce nahoře (zoom 4)\n# Pro definici podčtverců v dané oblasti smíte pou\236ít jen + nebo jen -, nesmíte to střídat.\n# Také nezapomeňte dát za číslo čtverce znaménko + nebo - následované menšítkem >\n3.5.2+> # JUST TEST\n+tl>t>\n+tl>b>tr\n+tr\n+bl \n3.5.3-> # JUST TEST\n-tl>t>\n-tl>b>tr\n-tr\n-bl \n", size=1266) at c:\libjpeg-turbo\libjpeg-turbo-gcc\texture-edit\jpeg-trubo_test\task_fnc.c:155
[debug]c:\libjpeg-turbo\libjpeg-turbo-gcc\texture-edit\jpeg-trubo_test\task_fnc.c:155:5727:beg:0x40d38b
[debug]>>>>>>cb_gdb:

At c:\libjpeg-turbo\libjpeg-turbo-gcc\texture-edit\jpeg-trubo_test\task_fnc.c:155

[debug]> next
[debug]Breakpoint 2, depthInStringExt (w=0x3e28d8, s=0x3e45de "# celý čtverec 4,2 v zoomu 3\n3.3.2->l>r # čtverec 3,2 v zoomu 3 kromě horních dvou čtverců v zoomu  4\n3.3.2->l # čtverec 3,2 v zoomu 3 kromě horních dvou čtverců v zoomu  4\n3.3.3+>tr# ze čtverce 3,3 v zoomu 3 se zahrne pouze roh vpravo nahoře (zoom 4)\n3.4.3+>t # ze čtverce 4,3 v zoomu 3 se zahrnou pouze dva čtverce nahoře (zoom 4)\n# Pro definici podčtverců v dané oblasti smíte pou\236ít jen + nebo jen -, nesmíte to střídat.\n# Také nezapomeňte dát za číslo čtverce znaménko + nebo - následované menšítkem >\n3.5.2+> # JUST TEST\n+tl>t>\n+tl>b>tr\n+tr\n+bl \n3.5.3-> # JUST TEST\n-tl>t>\n-tl>b>tr\n-tr\n-bl \n", size=1266) at c:\libjpeg-turbo\libjpeg-turbo-gcc\texture-edit\jpeg-trubo_test\task_fnc.c:174
[debug]c:\libjpeg-turbo\libjpeg-turbo-gcc\texture-edit\jpeg-trubo_test\task_fnc.c:174:6436:beg:0x40d38f
[debug]>>>>>>cb_gdb:

At c:\libjpeg-turbo\libjpeg-turbo-gcc\texture-edit\jpeg-trubo_test\task_fnc.c:174

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Debuger - confusion (F7 does not work)
« Reply #5 on: April 20, 2015, 10:20:33 am »
From the log we can see that CB has issued next command and gdb jumped from line 155 to line 174.
From the explanation in the first post it is not clear what is the code at line 155 and line 174.

Can you clarify? Also can you run command line debugger and execute the same commands? I'm sure you'll get the same effect.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline wever

  • Multiple posting newcomer
  • *
  • Posts: 49
Re: Debuger - confusion (F7 does not work)
« Reply #6 on: April 20, 2015, 11:19:00 am »
You can see it here:
http://paste.ideaslabs.com/show/Vr8qwnZY3s
The pasted code will be published 24h

I described where it jumps:
Code
I remove the line with printf("OH YES;"); ... so it jumps directly onto the line with blockDepthParser(w, &s, goOn); (there is breakpoint) ...

So online 176, to test the behaviour, I make comment:
//printf("OH YES");
and then I run the debugger, I press F8 to the first breakpoint on line 155, then I press F7 and it suddenly jumps to line 174 ... blockDepthParser(w, &s, goOn);
« Last Edit: April 20, 2015, 11:23:42 am by wever »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Debuger - confusion (F7 does not work)
« Reply #7 on: April 20, 2015, 11:36:12 am »
Can you execute a list gdb command after you've pressed f7 and debugger has stopped at the wrong place?
This command will print the code as gdb sees it.
It is possible that what gdb and what cb see as code and line number differs.

Also please try command line gdb and probably newer version of gdb (there are 4 versions after 7.5)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline wever

  • Multiple posting newcomer
  • *
  • Posts: 49
Re: Debuger - confusion (F7 does not work)
« Reply #8 on: April 20, 2015, 01:04:21 pm »
"execute a list gdb command"
How to do that? Do you mean "Send user command to debugger?" What commands?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Debuger - confusion (F7 does not work)
« Reply #9 on: April 20, 2015, 09:44:41 pm »
When cb has stopped on a breakpoint go to the debugger log tag, at the bottom there is a command field.
Enter 'list' (without quotes) and press enter.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline wever

  • Multiple posting newcomer
  • *
  • Posts: 49
Re: Debuger - confusion (F7 does not work)
« Reply #10 on: April 20, 2015, 10:18:01 pm »
>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
« Last Edit: April 20, 2015, 10:33:11 pm by wever »

Offline wever

  • Multiple posting newcomer
  • *
  • Posts: 49
Re: Debuger - confusion (F7 does not work)
« Reply #11 on: April 20, 2015, 11:04:29 pm »
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

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

Also notice that the abort_parseTaskFile(w,s,-1); is not executed when I run debugger (as expected).
« Last Edit: April 20, 2015, 11:06:17 pm by wever »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Debuger - confusion (F7 does not work)
« Reply #12 on: April 21, 2015, 12:07:57 am »
OK, now try running gdb from a cmd.exe window to confirm this is gdb or gcc problem.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline wever

  • Multiple posting newcomer
  • *
  • Posts: 49
Re: Debuger - confusion (F7 does not work)
« Reply #13 on: April 21, 2015, 10:22:39 am »
I don't know how to do that. How to run gdb from cmd?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: Debuger - confusion (F7 does not work)
« Reply #14 on: April 21, 2015, 09:25:01 pm »
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.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]