)]}'
{
  "commit": "338796db769342bffe41e362cb62bf2155345b2f",
  "tree": "2e027bb65e35273fef18ae586a3ca5b2c95d40e9",
  "parents": [
    "20adfa53dcbd19bc3d185ed7365e3f38d42f078c"
  ],
  "author": {
    "name": "Simon Marchi",
    "email": "simon.marchi@efficios.com",
    "time": "Mon Oct 27 15:41:51 2025 -0400"
  },
  "committer": {
    "name": "Simon Marchi",
    "email": "simon.marchi@efficios.com",
    "time": "Tue Oct 28 11:55:23 2025 -0400"
  },
  "message": "gdb/solib-rocm: avoid expensive gdbarch_from_bfd call in rocm_solib_relocate_section_addresses\n\nLoading a library containing a lot (\u003e 100k) sections proved very slow\nwith whenever the support for ROCm was built into gdb.  The culprit is\nthe gdbarch_from_bfd call in rocm_solib_relocate_section_addresses:\n\n    if (!is_amdgpu_arch (gdbarch_from_bfd (so.abfd.get ())))\n\nThis function gets called for every section, and gdbarch_from_bfd is\nsomewhat slow.  It turns out that we can skip the gdbarch_from_bfd call,\nsince all is_amdgpu_arch needs is the bfd_architecture value, which we\ncan directly extract from the `bfd *`, without going through the\ngdbarch.\n\nAdd an overload of is_amdgpu_arch that takes a `bfd *`, and use it in\nrocm_solib_relocate_section_addresses.\n\nUpdate a call site in rocm_solib_bfd_open to use the new overload as\nwell.  That call site is not as much in a hot path, but there is no\npoint in paying the extra cost of looking up the gdbarch there.  I\nremoved the other assert that checked that gdbarch_from_bfd returned a\nnon-nullptr value.  If that was the case, something would be very wrong\nwith ROCgdb, and the problem would manifest very soon after anyway.\n\nChange-Id: I55e9e68af59903b1b9727ff57388f9469d0e0002\nApproved-by: Lancelot Six \u003clancelot.six@amd.com\u003e (AMDGPU)\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "07ad307afc18610bf2bb652a5fbe251b7b8d0399",
      "old_mode": 33188,
      "old_path": "gdb/amdgpu-tdep.c",
      "new_id": "a2cb7d8984acb3f7704d523a2724e936fe8dab7f",
      "new_mode": 33188,
      "new_path": "gdb/amdgpu-tdep.c"
    },
    {
      "type": "modify",
      "old_id": "b468c6c098c5ec45bd3aa231cf2b7cb1c2098aac",
      "old_mode": 33188,
      "old_path": "gdb/amdgpu-tdep.h",
      "new_id": "67bcaaf243a59c21ccda5b97c44c5bcf77783e16",
      "new_mode": 33188,
      "new_path": "gdb/amdgpu-tdep.h"
    },
    {
      "type": "modify",
      "old_id": "3b121e67cc2b99d31525c80e0c4906295da87e48",
      "old_mode": 33188,
      "old_path": "gdb/solib-rocm.c",
      "new_id": "b48e4426fd4100e8f20ad439ed2800748686925b",
      "new_mode": 33188,
      "new_path": "gdb/solib-rocm.c"
    }
  ]
}
