This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: gdb printing of dynamically allocated matrix
On Wed, Jul 18, 2007 at 01:22:33PM +0200, Peter Toft wrote:
> * However how can I use GDB to see the contents of "b"
> similar to the contents of "c" and "a"?
> The best I can do is
> (gdb) print *b[0] @3
> (gdb) print *b[1] @3
> Obviously I would like to do the display in one command rather
> than several, especially if I changed the b-matrix to be b[7][8]
I don't believe this is possible without writing a user-defined
command for it - see the manual.
> How come that the next vector contains wrong values?
It's printing six consecutive elements from memory.
--
Daniel Jacobowitz
CodeSourcery