This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
gdb - Printing multiple arrays or arrays of arrays
- From: Dedeco <dedeco at ufmg dot br>
- To: gdb at sourceware dot org
- Date: Fri, 30 Jun 2006 15:42:10 -0300
- Subject: gdb - Printing multiple arrays or arrays of arrays
- Reply-to: Dedeco <dedeco at ufmg dot br>, gdb at sourceware dot org
Hello,
I know that having a:
int *vec = malloc( 10 * sizeof(int));
I would print the values of the 10 ints in gdb with:
(gdb)p vec@10
But what if I have:
int **vec = malloc( 9 * sizeof(int*));
for (i=0; i<10; i++)
vec[i] = malloc(10 *sizeof(int*));
How to print the 90 values I have?
Further, how would I print other such complex things? Like arrays of
structures with an array inside the last.
Thank you,
Dedeco