This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Adding support for pretty printing of 2D arrays


On Thu, 17 Apr 2014 14:06:54 +0200, Morten Olsen Lysgaard wrote:
> I would like to know if it makes sense to add 2D, and possibly a
> n-dimensional, array pretty printing hint and logic?

FYI there was for some time support for 2D printing in Fedora GDB but it was
later removed and it is probably no longer relevant for current GDB.
Also from what I heard the way it was implement was not right.


Jan


Author: Chris Moller (Red Hat that time)
Originally added by Fedora commit:
	http://pkgs.fedoraproject.org/cgit/gdb.git/commit/?id=6068e6305ed7d05b4a919c28aa5bcb737e1f163b
Removed by Fedora commit:
	http://pkgs.fedoraproject.org/cgit/gdb.git/commit/?id=f8eee055504d803578fc226027045ef37277c9f6


gdb_test "p test2" "= $nl  {$nl    {.*"
# Complete result is:
#
# (gdb) p test2
# $2 =
#   {
#     {0      1    }
#     {2      3    }
#     {4      5    }
#  }

gdb_test "p test3" "= $nl  {$nl    {$nl      {.*"
# Complete result is:
#
# (gdb) p test3
# $3 =
#   {
#     {
#       {0        1        }
#       {10        11        }
#       {20        21        }
#     }
#     {
#       {100        101        }
#       {110        111        }
#       {120        121        }
#     }
#     {
#       {200        201        }
#       {210        211        }
#       {220        221        }
#     }
#     {
#       {300        301        }
#       {310        311        }
#       {320        321        }
#     }
#  }

Attachment: gdb-bz562763-pretty-print-2d-vectors.patch
Description: Text document

Attachment: gdb-bz562763-pretty-print-2d-vectors-libstdcxx.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]