)]}'
{
  "commit": "3d6744493634e704b6977924a0cc8082886523f5",
  "tree": "0238ad065b7d0372311b8e900df1d13376e27147",
  "parents": [
    "59d25b31eb54130f1115aae20da4ac9ccaa15a53"
  ],
  "author": {
    "name": "Tom Tromey",
    "email": "tromey@adacore.com",
    "time": "Thu Jun 06 09:42:15 2024 -0600"
  },
  "committer": {
    "name": "Tom Tromey",
    "email": "tromey@adacore.com",
    "time": "Mon Dec 16 11:18:20 2024 -0700"
  },
  "message": "Greatly speed up rbreak\n\nWhile debugging another issue, I noticed that \u0027rbreak\u0027 on a large\nprogram was very slow.  In particular, with \u0027maint time 1\u0027:\n\n(gdb) with pagination off -- rbreak ^command_display\n[...]\nCommand execution time: 1940.646332 (cpu), 1960.771517 (wall)\n\n\"ps\" also reported that, after this command, gdb\u0027s VSZ was 4619360.\n\nLooking into this, I found something strange.  When \u0027rbreak\u0027 found a\nfunction \"f\" in file \"file.adb\", it would try to set the breakpoint\nusing \"break \u0027file.adb\u0027:\u0027f\u0027\".\n\nThis then interacted somewhat poorly with linespec.  linespec first\nexpands all the symtabs matching \"file.adb\", but in this program this\nresults in thousands of CU expansions (probably due to inlining, but I\ndid not investigate).\n\nThere is probably a linespec bug here.  It would make more sense for\nit to combine the file- and symbol- lookups, as this is more\nefficient.  I plan to file a bug about this at least.\n\nI tracked this \"file:function\" style of linespec to the earliest days\nof gdb.  Back then, \"break function\" would only break on the first\n\"function\" that was found -- it wasn\u0027t until much later that we\nchanged gdb to break on all matching functions.  So, I think that\nrbreak was written this way to try to work around this limitation, and\nit seems to me that this change obsoleted the need for rbreak to\nmention the file at all.\n\nThat is, \"break file:function\" is redundant now, because plain\n\"break function\" will redo that same work -- just more efficiently.\n(The only exception to this is the case where a file is given\nto rbreak -- here the extra filtering is still needed.)\n\nThis patch implements this.  On the aforementioned large program, with\nthis patch, rbreak still sets all the desired breakpoints (879 of\nthem) but is now much faster:\n\n(gdb) with pagination off -- rbreak ^command_display\n[...]\nCommand execution time: 91.702648 (cpu), 92.770430 (wall)\n\nIt also reduces the VSZ number to 2539216.\n\nRegression tested on x86-64 Fedora 40.\n\nBug: https://sourceware.org/bugzilla/show_bug.cgi?id\u003d14340\nApproved-By: Pedro Alves \u003cpedro@palves.net\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "72a18dce2b7429fd4d2c5f0e5a1abdbde2774377",
      "old_mode": 33188,
      "old_path": "gdb/symtab.c",
      "new_id": "106e540ca48f28fb279e9caf8e4f135fcff77378",
      "new_mode": 33188,
      "new_path": "gdb/symtab.c"
    }
  ]
}
