sukopiliuojam su -g ir -O0 (shitas parametras dar nzn ka reihskia)
tada gdb ./programa
run paleidzhia programa
break [eilute] breiakpointas
delete break
next pereit eilute
step zhengti (ieina y funkcija)
quit isheit
print [kint] atspausdint ka turim
where kur smaukomes
until [sk] iki kur xujarint
-O0 Reduce compilation time and make debugging produce the expected results. This is the default.
tik kodel be shito kai kuriu kintamuju nerodo o meta "value optimized out"
paliedzhiam koda su mpicc
tada ps aux | grep
tada gdb programa pidas
ilendam y programos siela :)
spausdinam masyva
(gdb) set $pos=0
(gdb) print array[$pos++]
ir ishvis http://www.yolinux.com/TUTORIALS/GDB-Commands.html