)]}'
{
  "commit": "5713f3b05038b4b879bdc0922d7c8ab5a9cf76aa",
  "tree": "9216420b145cc5e4a506cd618e6c2ad33ef58db6",
  "parents": [
    "0518123c82c635b6c1da078f25a571043f6f18bf"
  ],
  "author": {
    "name": "Simon Marchi",
    "email": "simon.marchi@polymtl.ca",
    "time": "Tue Dec 09 14:32:14 2025 -0500"
  },
  "committer": {
    "name": "Simon Marchi",
    "email": "simon.marchi@polymtl.ca",
    "time": "Wed Jul 08 17:40:41 2026 -0400"
  },
  "message": "gdb: change default objfile iteration order to start with current objfile\n\nThe current default objfile search strategy, defined both in\nsolib_ops::iterate_over_objfiles_in_search_order (when the solib_ops\nhasn\u0027t overridden it) and in\nprogram_space::iterate_over_objfiles_in_search_order (when there is no\nsolib_ops in the program space, for some reason), is to scan the objfile\nlist linearly.\n\nprogram_space::iterate_over_objfiles_in_search_order:\n\n    for (auto \u0026objfile : this-\u003eobjfiles ())\n      if (cb (\u0026objfile))\n        return;\n\nsolib_ops::iterate_over_objfiles_in_search_order:\n\n    for (objfile \u0026objfile : m_pspace-\u003eobjfiles ())\n      if (cb (\u0026objfile))\n        return;\n\nThe following patch adds support for multiple concurrent solib_ops in a\nprogram space.  Everything that deals with an solib_ops needs to be\nadapted to deal with multiple solib_ops, including\nprogram_space::iterate_over_objfiles_in_search_order.  What I came up\nwith for that method introduces a change in behavior where the current\nobjfile will always be searched first.  Rather than hide the change in\nbehavior in that big patch, do it in this preparatory patch, in the hope\nthat any potential problems it causes can be more easily bisected and\nanalyzed.\n\nConcretely, the change is to check the current objfile first, in the two\nspots:\n\n    if (current_objfile !\u003d nullptr \u0026\u0026 cb (current_objfile))\n      return;\n\nThis happens to be what windows_solib_ops did, so remove that\nspecialization.\n\nsvr4_solib_ops already has its own iterate_over_objfiles_in_search_order\nthat conditionally checks the current objfile first, based on the\nDT_SYMBOLIC dynamic tag.  So it is not affected by this change.\n\nThe solib_ops potentially affected by this change are (we know that\nrocm_solib_ops doesn\u0027t care):\n\n - frv_solib_ops\n - target_solib_ops\n - darwin_solib_ops\n - dsbt_solib_ops\n - aix_solib_ops\n\nI don\u0027t really know if searching objfiles in order (so, main objfile\nfirst typically) is essential for any of these solib_ops.\nIntuitively, searching the current objfile first makes sense, unless\nthere is some fancy symbol interposition happening, in which case that\nsolib_ops should probably implement a custom\niterate_over_objfiles_in_search_order.\n\nChange-Id: I58195af6b53ca202e6061a5f36d5f74e1a0d5c17\nApproved-By: Tom Tromey \u003ctom@tromey.com\u003e\nBug: https://sourceware.org/bugzilla/show_bug.cgi?id\u003d17003\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "1407b058dfdf2b828d98c98c1a6b693c7e60d887",
      "old_mode": 33188,
      "old_path": "gdb/progspace.c",
      "new_id": "7023ccddc546cac90f2777529d638d4055f3a594",
      "new_mode": 33188,
      "new_path": "gdb/progspace.c"
    },
    {
      "type": "modify",
      "old_id": "b9b0f11cb4777041894100bada7046f89a5f0da0",
      "old_mode": 33188,
      "old_path": "gdb/solib.c",
      "new_id": "6ed56aaf51592a0567e15f925e197af285868eaa",
      "new_mode": 33188,
      "new_path": "gdb/solib.c"
    },
    {
      "type": "modify",
      "old_id": "261c38b35635dec15f7deddbb0479fa117e10511",
      "old_mode": 33188,
      "old_path": "gdb/windows-tdep.c",
      "new_id": "d65e6e76faeb09c042394624f68b74238dec0497",
      "new_mode": 33188,
      "new_path": "gdb/windows-tdep.c"
    }
  ]
}
