I have a 2d array matrix[10][10] that I\'d like to inspect at debug time.
I understand that I can do this in GDB using
p *matrix@10
This is a more helpful extension of the last post. Also you can use: print var @cols@rows
define printMatrix
set $arr = $arg0
set $rows = $arg1
set $cols = $arg2
set $i = 0
printf "\n"
while $i < $rows
set $j = 0
while $j < $cols
printf "%8.4f,",$arr[$i*$cols + $j]
set $j = $j + 1
end
printf "\n"
set $i = $i + 1
end