Let's say I have an array of pointers:
struct S {int x;};
S *arr[3] = {new S{1}, new S{2}, new S{3}};
I want to make gdb dereference and print each element of the array.
Printing one element is simple:
(gdb) p *arr[0]
$1 = {x = 1}
but I want to print every element in the array in this fashion.
I tried p arr, but it outputs the pointers, rather than the objects they point to:
(gdb) p arr
$1 = {0x613c20, 0x613c40, 0x613c60}