)]}'
{
  "commit": "b80a4347fc63b1a6ed6e2b3ea26c5948f08ba3cd",
  "tree": "bf852946b18da4912c401af1e35f02a840052cc0",
  "parents": [
    "e21755893e22a9458f48b7f9b84a74de43039151"
  ],
  "author": {
    "name": "David Faure",
    "email": "david.faure@kdab.com",
    "time": "Mon Jul 27 20:02:29 2026 +0200"
  },
  "committer": {
    "name": "Jonathan Wakely",
    "email": "redi@gcc.gnu.org",
    "time": "Tue Jul 28 11:00:49 2026 +0100"
  },
  "message": "libstdc++: Fix num_children of the map pretty-printers\n\nStdMapPrinter and Tr1UnorderedMapPrinter yield a separate child for the\nkey and for the value of every element, as their \u0027map\u0027 display hint\nrequires, but their num_children methods return the number of elements,\ni.e. half of what children() produces.\n\nGDB counts the children itself where it does not use num_children, so\nthe two disagree about the same map. For a std::map with 2 elements:\n\n    (gdb) interpreter-exec mi \"-enable-pretty-printing\"\n    (gdb) interpreter-exec mi \"-var-create v * m\"\n    (gdb) interpreter-exec mi \"-var-list-children v\"\n    ^done,numchild\u003d\"4\",displayhint\u003d\"map\",children\u003d[...]\n\nwhile num_children() returns 2.  The DAP code in gdb treats the two as\ninterchangeable: gdb/python/lib/gdb/dap/varref.py calls num_children()\nwhen the printer has one, and falls back to len(list(children())) when\nit does not, so a DAP client sees half the children of a std::map,\nstd::multimap or std::unordered_map.\n\nStdSetPrinter and the sequence container printers yield one child per\nelement, so they are correct as they are.\n\nlibstdc++-v3/ChangeLog\n\n\t* python/libstdcxx/v6/printers.py (StdMapPrinter.num_children):\n\tCount two children per element.\n\t(Tr1UnorderedMapPrinter.num_children): Likewise.\n\nSigned-off-by: David Faure \u003cdavid.faure@kdab.com\u003e\nReviewed-by: Tom Tromey \u003ctromey@adacore.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "eff4b72c1d8a12dbd9c3cb08820459facd452e92",
      "old_mode": 33188,
      "old_path": "libstdc++-v3/python/libstdcxx/v6/printers.py",
      "new_id": "1bba377513cadedcad572bc3941f72d88d663be1",
      "new_mode": 33188,
      "new_path": "libstdc++-v3/python/libstdcxx/v6/printers.py"
    }
  ]
}
