syntax for gdb to print elements of 2D array?
Hi.
The syntax for gdb to print all the elements of a 1-D array is: Code:
Code:
(gdb) p myIntArray[3]@5 Thanks |
I don't know the gdb's syntax, but perhaps you could help yourself with ddd (if you're running X), it's actually a really sophisticated GUI for gdb, which can also graphically display the arrays and it displays the gdb commands it uses.
http://www.gnu.org/software/ddd/ |
Thanks for that...but Suse(this and previous version anyway, I think!) is missing a certain Motif file Xm needed to build the GUI. I've come across this problem before trying to install another GUI program. I could install the Lesstif package in it's place but don't think it's worth the trouble for all I need to do...
So if anyone does know the command line gdb syntax for checkin gthe elements of a multi-dimensional array? thanks |
ok. I think the syntax is:
Code:
print array(2,3) but I can't check this because my array is messed up! entering Code:
ptype myarray doing this for the array that I am trying to get at gives: Code:
(gdb) ptype bderi Can anyone confirm this? |
if you do a lot of C programming
ddd is definitely worth it. |
All times are GMT -5. The time now is 08:28 PM. |