jordi@iot-clot:~/Documents/curs2020-2021/m03/daw/20210324/20190411_daw_m03uf2_ord/sol$ gcc -g cc03.c -o ex01 jordi@iot-clot:~/Documents/curs2020-2021/m03/daw/20210324/20190411_daw_m03uf2_ord/sol$ gdb ex01 GNU gdb (Debian 10.1-1.7) 10.1.90.20210103-git Copyright (C) 2021 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ex01... (gdb) list 20,34 20 } 21 22 int nDigitControl(char *sz,int* pN){ 23 int nSuma = 0,nDC; 24 25 if(nQuantsCaracters(sz) == 8) 26 pN += 2; 27 while(*sz){ 28 nSuma += (*sz - '0') * *pN; 29 sz++; pN++; 30 } 31 nDC = 11 - nSuma % 11; 32 if(nDC == 11) nDC = 0; 33 if(nDC == 10) nDC = 1; 34 (gdb) break 29 Breakpoint 1 at 0x11a7: file cc03.c, line 29. (gdb) run Starting program: /home/jordi/Documents/curs2020-2021/m03/daw/20210324/20190411_daw_m03uf2_ord/sol/ex01 Breakpoint 1, nDigitControl (sz=0x7fffffffdfb7 "12345678", pN=0x7fffffffdf78) at cc03.c:29 29 sz++; pN++; (gdb) print nSuma $1 = 4 (gdb) next 27 while(*sz){ (gdb) next 28 nSuma += (*sz - '0') * *pN; (gdb) next Breakpoint 1, nDigitControl (sz=0x7fffffffdfb8 "2345678", pN=0x7fffffffdf7c) at cc03.c:29 29 sz++; pN++; (gdb) print nSuma $2 = 20 (gdb) next 27 while(*sz){ (gdb) next 28 nSuma += (*sz - '0') * *pN; (gdb) next Breakpoint 1, nDigitControl (sz=0x7fffffffdfb9 "345678", pN=0x7fffffffdf80) at cc03.c:29 29 sz++; pN++; (gdb) print nSuma $3 = 35 (gdb) quit A debugging session is active. Inferior 1 [process 228146] will be killed. Quit anyway? (y or n) y jordi@iot-clot:~/Documents/curs2020-2021/m03/daw/20210324/20190411_daw_m03uf2_ord/sol$